:root {
  --brand: #deb4de;
  --paper: #f7eef7;
  --paper-2: #fffafd;
  --ink: #1c1714;
  --ink-soft: #5e574e;
  --line: #e8d5e8;
  --accent: #9a5f9a;
  --accent-dark: #7d4a7d;
  --teal: #8b5a8b;
  --shadow: 0 18px 40px rgba(90, 50, 90, 0.08);
  --radius: 22px;
  --header-h: 76px;
  --a1: #4a9a52;
  --a2: #2a92b6;
  --b1: #c9891a;
  --b2: #b33b2b;
  --font: system-ui, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: auto;
  scrollbar-gutter: stable;
  overflow-x: hidden;
  overflow-y: scroll;
}

html.is-restoring {
  visibility: hidden;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
  font-size: 1.125rem;
  line-height: 1.55;
  min-height: 100vh;
  width: 100vw;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

h1,
h2,
h3,
.serif {
  font-family: var(--font);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.12;
}

.skip {
  position: absolute;
  left: -999px;
  top: 8px;
}

.skip:focus {
  left: 8px;
  z-index: 80;
  background: var(--ink);
  color: #fff;
  padding: 8px 12px;
  border-radius: 8px;
}

.wrap {
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-h);
  background: var(--accent);
  border-bottom: 1px solid transparent;
  color: #fff;
}

.site-header.is-scrolled {
  border-bottom-color: color-mix(in srgb, #000 12%, var(--accent));
}

.site-header__inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 10px;
  font-weight: 650;
  letter-spacing: -0.03em;
  color: #fff;
}

.brand img {
  width: 50px;
  height: 50px;
  max-width: none;
}

.brand span {
  font-family: var(--font);
  font-size: 1.45rem;
  color: #fff;
}

.nav {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 6px;
}

.nav a {
  padding: 8px 12px;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.88);
  font-weight: 500;
}

.nav a:hover,
.nav a.is-active {
  color: #fff;
  background: color-mix(in srgb, #fff 22%, transparent);
}

.nav .btn {
  min-height: 42px;
  min-width: 6rem;
  margin-left: 4px;
  justify-content: center;
  white-space: nowrap;
  box-sizing: border-box;
}

.nav .btn[data-cta="user"] {
  display: none;
}

html.is-logged .nav .btn[data-cta="guest"] {
  display: none;
}

html.is-logged .nav .btn[data-cta="user"] {
  display: inline-flex;
}

.nav .btn--solid {
  background: #c070c0;
  color: #fff;
}

.nav .btn--solid:hover,
.nav .btn--solid.is-active {
  background: #7d4a7d;
  color: #fff;
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: color-mix(in srgb, #fff 12%, transparent);
  border-radius: 12px;
  cursor: pointer;
  color: #fff;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.15s ease,
    color 0.15s ease;
}

.btn--solid {
  background: var(--accent);
  color: #fff;
}

.btn--solid:hover {
  background: var(--accent-dark);
}

.btn.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

#abrir-partida {
  min-height: 60px;
  padding: 0 28px;
  font-size: 1.35rem;
  transition: none;
}

.btn--green {
  background: #1f8a70;
  color: #fff;
}

.btn--green:hover {
  background: color-mix(in srgb, #1f8a70 72%, #000);
}

.btn--ghost {
  background: var(--paper-2);
  border-color: var(--line);
}

[data-page="cuenta"] #salir:hover {
  background: #c62828;
  border-color: #c62828;
  color: #fff;
}

.btn--ink {
  background: var(--ink);
  color: #fff;
}

.btn--wide {
  width: 100%;
}

.hero {
  padding: 48px 0 28px;
}

.hero__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
  align-items: center;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  color: var(--teal);
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.hero h1 {
  font-size: clamp(2.1rem, 4.9vw, 3.75rem);
  margin: 12px 0 16px;
}

.hero__es {
  position: relative;
  display: inline-block;
}

.hero__mascot {
  position: absolute;
  left: calc(clamp(52px, 12vw, 100px) * -1.2);
  top: calc(100% + clamp(12px, 3vw, 30px));
  width: clamp(52px, 12vw, 100px);
  max-width: none;
  height: auto;
}

[data-page="jueguitos2"] .hero__mascot {
  left: calc(clamp(96px, 22vw, 200px) * 0.5);
  top: calc(100% - clamp(8px, 2vw, 20px));
  width: clamp(96px, 22vw, 200px);
  max-width: none;
}

[data-page="jueguitos2"] .hero__mascot.is-obrero {
  width: clamp(76px, 18vw, 160px);
}

[data-page="home"] .hero {
  padding: clamp(20px, 3vw, 36px) 0 8px;
}

.hero__stage {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  align-items: center;
  gap: clamp(24px, 4vw, 64px);
  padding: clamp(36px, 5.5vw, 80px) clamp(28px, 5.5vw, 80px);
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) * 1.6);
  box-shadow: var(--shadow);
  overflow: hidden;
}

[data-page="home"] .hero .kicker {
  margin: 0;
  padding: 6px 14px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand) 40%, transparent);
  color: var(--accent-dark);
}

[data-page="home"] .hero h1 {
  font-size: clamp(2.5rem, 5.6vw, 4.5rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
  margin: 18px 0 0;
  text-wrap: balance;
}

[data-page="home"] .hero__es {
  isolation: isolate;
  color: var(--accent-dark);
  white-space: nowrap;
}

.hero__swash {
  position: absolute;
  z-index: -1;
  left: -3%;
  bottom: 0.02em;
  width: 106%;
  height: 0.3em;
  color: var(--brand);
}

[data-page="home"] .hero .lede {
  max-width: 36ch;
  margin: 26px 0 0;
  text-align: left;
}

.hero__where {
  margin: 10px 0 0;
  font-size: 1.25rem;
  font-weight: 650;
  color: var(--accent-dark);
}

[data-page="home"] .hero__actions {
  margin-top: 34px;
}

[data-page="home"] .hero__actions .btn {
  min-height: 56px;
  padding: 0 28px;
  font-size: 1.08rem;
}

.hero__art {
  position: relative;
  display: grid;
  place-items: center;
  align-self: stretch;
}

.hero__art::before {
  content: "";
  position: absolute;
  width: min(118%, 420px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(
    circle at 50% 45%,
    var(--brand),
    color-mix(in srgb, var(--brand) 0%, transparent) 70%
  );
  opacity: 0.75;
}

.hero__art::after {
  content: "";
  position: absolute;
  bottom: calc(50% - clamp(120px, 15vw, 190px));
  width: clamp(110px, 13vw, 170px);
  height: 18px;
  border-radius: 50%;
  background: rgba(90, 50, 90, 0.16);
  filter: blur(6px);
}

[data-page="home"] .hero__mascot {
  position: relative;
  left: auto;
  top: auto;
  z-index: 1;
  /* En línea al final del título: se mide en em para crecer y encoger con el h1. */
  display: inline-block;
  width: auto;
  height: 1.6em;
  max-width: none;
  margin-left: 0.1em;
  vertical-align: -0.25em;
  animation: hero-float 6s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}

@keyframes hero-float {
  50% {
    transform: translateY(-0.08em);
  }
}

.lede {
  font-size: 1.25rem;
  color: var(--ink-soft);
  max-width: 38ch;
}

.hero .lede {
  text-align: justify;
  margin-top: 28px;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.section {
  padding: 56px 0;
}

.section__head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin-bottom: 28px;
}

.section__head a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.section h2 {
  font-size: clamp(1.4rem, 2.25vw, 2rem);
  margin: 0;
}

.muted {
  color: var(--ink-soft);
}

.levels {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.level-tile {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 22px;
  transition: transform 0.15s ease;
}

.level-tile:hover {
  transform: translateY(-3px);
}

.level-tile em {
  display: block;
  font-style: normal;
  color: var(--ink-soft);
  margin-top: 0;
  font-size: 1.1rem;
}

.level-tile .badge {
  width: 56px;
  height: 56px;
  min-height: 56px;
  padding: 0;
  justify-content: center;
  border-radius: 50%;
  font-size: 1.15rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fff;
}

.badge--A0 {
  background: #8b5a3c;
}
.badge--A1 {
  background: var(--a1);
}

button.card {
  width: 100%;
  padding: 0;
  text-align: left;
  color: inherit;
  cursor: pointer;
  font: inherit;
}

.video-stage {
  margin: 8px 0 28px;
}

.video-stage[hidden] {
  display: none;
}

.nivel-circulos {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  margin-top: 8px;
}

.nivel-circulo {
  width: 100px;
  height: 100px;
  border: 4px solid #fff;
  border-radius: 50%;
  color: #fff;
  font-size: 2.1rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.nivel-circulo.is-on {
  transform: translateY(-4px);
  box-shadow:
    0 0 0 4px var(--paper),
    0 0 0 7px currentColor;
}

.nivel-panel {
  margin-top: 36px;
}

.nivel-panel[hidden] {
  display: none;
}

[data-page="videocursos"] .video-fila {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  overflow-x: scroll;
  padding: 10px 6px 10px;
  scrollbar-color: var(--accent) var(--paper);
  scrollbar-width: auto;
}

[data-page="videocursos"] .video-fila::-webkit-scrollbar {
  height: 12px;
}

[data-page="videocursos"] .video-fila::-webkit-scrollbar-track {
  background: var(--line);
  border-radius: 999px;
}

[data-page="videocursos"] .video-fila::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 999px;
}

[data-page="videocursos"] .video-fila .card {
  flex: 0 0 260px;
  width: 260px;
  height: auto;
  min-height: 0;
  content-visibility: visible;
  contain-intrinsic-size: auto;
  border-radius: 8px;
}

[data-page="videocursos"] .video-fila .card.is-on {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

[data-page="videocursos"] .video-fila .card .cover {
  height: auto;
  aspect-ratio: 16 / 9;
}

[data-page="videocursos"] .video-fila .card--pronto {
  pointer-events: none;
  background: #fff;
}

[data-page="videocursos"] .video-fila .card--pronto .cover {
  display: grid;
  place-content: center;
  gap: 6px;
  text-align: center;
  background: #fff;
  color: #3a2a1a;
}

[data-page="videocursos"] .video-fila .card--pronto strong {
  font-size: 1.45rem;
}

[data-page="videocursos"] .video-fila .card--pronto span {
  font-size: 1.2rem;
}

[data-page="videocursos"] .nivel-panel .video-stage {
  margin-top: 22px;
}

@media (max-width: 640px) {
  .nivel-circulo {
    width: 88px;
    height: 88px;
    font-size: 1.7rem;
  }
}
.badge--A2 {
  background: var(--a2);
}
.badge--B1 {
  background: var(--b1);
}
.badge--B2 {
  background: var(--b2);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 23px 0 7px;
}

.filter {
  min-height: 52px;
  padding: 0 22px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  font-weight: 600;
  font-size: 1.12rem;
}

.filter[data-nivel="A1"],
.filter[data-nivel="A2"],
.filter[data-nivel="B1"],
.filter[data-nivel="B2"] {
  width: 72px;
  padding-inline: 0;
}

.filter.is-on,
.filter:hover {
  color: #fff;
}

.filter[data-nivel="todos"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.filter[data-nivel="todos"]:hover,
.filter[data-nivel="todos"].is-on {
  background: color-mix(in srgb, var(--accent) 58%, #fff);
  border-color: color-mix(in srgb, var(--accent) 58%, #fff);
}

.filter[data-nivel="A1"] {
  background: var(--a1);
  border-color: var(--a1);
  color: #fff;
}

.filter[data-nivel="A1"]:hover,
.filter[data-nivel="A1"].is-on {
  background: color-mix(in srgb, var(--a1) 58%, #fff);
  border-color: color-mix(in srgb, var(--a1) 58%, #fff);
}

.filter[data-nivel="A2"] {
  background: var(--a2);
  border-color: var(--a2);
  color: #fff;
}

.filter[data-nivel="A2"]:hover,
.filter[data-nivel="A2"].is-on {
  background: color-mix(in srgb, var(--a2) 58%, #fff);
  border-color: color-mix(in srgb, var(--a2) 58%, #fff);
}

.filter[data-nivel="B1"] {
  background: var(--b1);
  border-color: var(--b1);
  color: #fff;
}

.filter[data-nivel="B1"]:hover,
.filter[data-nivel="B1"].is-on {
  background: color-mix(in srgb, var(--b1) 58%, #fff);
  border-color: color-mix(in srgb, var(--b1) 58%, #fff);
}

.filter[data-nivel="B2"] {
  background: var(--b2);
  border-color: var(--b2);
  color: #fff;
}

.filter[data-nivel="B2"]:hover,
.filter[data-nivel="B2"].is-on {
  background: color-mix(in srgb, var(--b2) 58%, #fff);
  border-color: color-mix(in srgb, var(--b2) 58%, #fff);
}

.filter[data-nivel="proximamente"] {
  border-style: dashed;
  border-color: #c9b8c9;
  color: #7a6a7a;
}

.filter[data-nivel="proximamente"].is-on,
.filter[data-nivel="proximamente"]:hover {
  background: #f0e8f0;
  border-color: #c9b8c9;
  border-style: dashed;
  color: #5e4a5e;
}

.badge--soon {
  background: #fff;
  color: #000;
  left: auto;
  right: 14px;
}

.card--soon {
  opacity: 0.92;
}

.cover--A1 {
  background: linear-gradient(
    145deg,
    color-mix(in srgb, var(--a1) 42%, #fff),
    var(--a1)
  );
}
.cover--A2 {
  background: linear-gradient(
    145deg,
    color-mix(in srgb, var(--a2) 42%, #fff),
    var(--a2)
  );
}
.cover--B1 {
  background: linear-gradient(
    145deg,
    color-mix(in srgb, var(--b1) 42%, #fff),
    var(--b1)
  );
}
.cover--B2 {
  background: linear-gradient(
    145deg,
    color-mix(in srgb, var(--b2) 42%, #fff),
    var(--b2)
  );
}

.cover__spin {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 44px;
  height: 44px;
  border: 3px solid rgb(255 255 255 / 35%);
  border-top-color: #fff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: cover-spin 2.6s linear infinite;
}

@keyframes cover-spin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

.card--soon .cover .badge--soon {
  position: absolute;
  top: 14px;
  left: auto;
  right: 14px;
}

.ficha .cover .badge:not(.badge--soon) {
  z-index: 1;
  top: 14px;
  left: auto;
  right: 14px;
  width: 52px;
  height: 52px;
  min-height: 52px;
  padding: 0;
  justify-content: center;
  border-radius: 50%;
  font-size: 1.15rem;
}

.ficha .cover .cover-levels .badge {
  position: static;
  top: auto;
  left: auto;
  right: auto;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

[data-page="jueguitos2"] #catalogo {
  min-height: 70vh;
  align-content: start;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 100%;
  content-visibility: auto;
  contain-intrinsic-size: auto 420px;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.cover {
  height: 168px;
  position: relative;
  overflow: hidden;
}

.cover svg,
.cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card .cover img {
  object-position: var(--ox, var(--x, 50%)) var(--oy, var(--y, 50%));
  transform: translate(var(--dx, 0px), var(--dy, 0px))
    scale(var(--zoom, 1), var(--zoom-y, var(--zoom, 1)));
  transform-origin: var(--x, 50%) var(--y, 50%);
}

.ficha .cover img {
  object-position: calc(var(--x, 50%) + var(--dx, 0px))
    calc(var(--oy, var(--y, 50%)) + var(--dy, 0px));
  transform: translateY(var(--pan-y, 0px))
    scale(var(--zoom, 1), var(--zoom-y, var(--zoom, 1)));
  transform-origin: center center;
}

.cover--reel > img {
  opacity: 0;
  z-index: 0;
  animation: cover-reel 18s linear infinite;
}

.cover--reel > img:first-child {
  opacity: 1;
}

.cover--reel > img:nth-child(1) {
  animation-delay: 0s;
}
.cover--reel > img:nth-child(2) {
  animation-delay: 3s;
}
.cover--reel > img:nth-child(3) {
  animation-delay: 6s;
}
.cover--reel > img:nth-child(4) {
  animation-delay: 9s;
}
.cover--reel > img:nth-child(5) {
  animation-delay: 12s;
}
.cover--reel > img:nth-child(6) {
  animation-delay: 15s;
}

@keyframes cover-reel {
  0%,
  16.7% {
    opacity: 1;
    z-index: 1;
  }
  16.71%,
  100% {
    opacity: 0;
    z-index: 0;
  }
}

.cover .badge {
  position: absolute;
  top: 14px;
  left: 14px;
}

.cover .badge:not(.badge--soon) {
  border: 3px solid #fff;
}

.card .cover .badge:not(.badge--soon) {
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  justify-content: center;
  border-radius: 50%;
  font-size: 1rem;
}

.cover-levels {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, auto);
  gap: 8px;
  place-content: start;
  pointer-events: none;
}

.cover-levels .badge {
  position: static;
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  justify-content: center;
  border-radius: 50%;
  font-size: 1rem;
  border: 3px solid #fff;
}

.ficha .cover .cover-levels .badge {
  width: 52px;
  height: 52px;
  min-height: 52px;
  font-size: 1.15rem;
}

.card__body {
  padding: 18px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.card__body h3 {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.3;
  height: calc(1.35rem * 1.3 * 2);
  color: var(--ink);
  font-weight: 500;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}

.card__body h3 strong {
  font-weight: 700;
  font-size: 1.35rem;
}

.card__body h3 .card__con {
  color: var(--ink-soft);
  font-weight: 500;
  font-size: 1.1rem;
}

.story {
  color: var(--ink-soft);
  font-weight: 500;
}

.card .story {
  color: var(--accent);
  font-weight: 600;
  font-size: 1.12rem;
  line-height: 1.35;
  height: 1.35em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card__acts {
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.2;
  height: 1.2em;
  white-space: nowrap;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  padding-top: 8px;
}

.card .tags {
  flex-wrap: nowrap;
  min-height: 28px;
}

.card .tag {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tag {
  font-size: 0.78rem;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink-soft);
}

.ficha .tag {
  background: var(--paper-2);
}

.page-head {
  padding: 48px 0 48px;
}

[data-page="jueguitos2"] .page-head {
  padding-bottom: 28px;
}

.page-head h1 {
  font-size: clamp(1.65rem, 3.75vw, 2.7rem);
  margin: 8px 0 10px;
}

.page-head .lede {
  text-align: justify;
}

[data-page="holi"] .page-head .lede,
[data-page="videocurso"] .page-head .lede {
  max-width: 65ch;
}

[data-page="precios"] .page-head .lede {
  max-width: 72ch;
}

.video-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  max-width: 960px;
  margin-top: 28px;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #000;
}

.video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

[data-page="videocurso"] .page-head a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

[data-page="videocurso"] .section {
  padding-top: 8px;
}

[data-page="videocurso"] #videocurso .cover {
  background: color-mix(in srgb, #1f8a70 32%, #fff);
}

[data-page="videocurso"] #lecciones .cover {
  background: color-mix(in srgb, var(--accent) 32%, #fff);
}

[data-page="videocurso"] #actividades .cover {
  background: color-mix(in srgb, var(--a2) 32%, #fff);
}

[data-page="videocurso"] .card .cover .badge {
  top: 14px;
  left: auto;
  right: 14px;
  width: auto;
  height: auto;
  min-height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  font-size: 0.78rem;
  background: #1f8a70;
}

[data-page="holi"] .page-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 440px;
  gap: 28px 52px;
  align-items: start;
  padding-bottom: 16px;
}

[data-page="holi"] .section {
  padding-top: 8px;
}

.holi-photos {
  position: relative;
  width: 440px;
  height: 507px;
  margin-top: 40px;
  margin-left: 0;
}

.holi-photo {
  position: absolute;
  border-radius: 14px;
  border: 4px solid #fff;
  background: var(--paper-2);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.holi-photo:nth-child(1) {
  top: 34px;
  left: 0;
  width: 249px;
  height: 249px;
  transform: rotate(-8deg);
  z-index: 2;
  background: #f6e8f6;
}

.holi-photo:nth-child(2) {
  top: 0;
  right: 5px;
  width: 213px;
  height: 239px;
  transform: rotate(7deg);
  z-index: 3;
  background: #ead5ea;
}

.holi-photo:nth-child(3) {
  bottom: 24px;
  left: 10px;
  width: 222px;
  height: 209px;
  transform: rotate(5deg);
  z-index: 1;
  background: #fffafd;
}

.holi-photo:nth-child(4) {
  bottom: 0;
  right: 0;
  width: 253px;
  height: 229px;
  transform: rotate(-6deg);
  z-index: 4;
  background: #e4d0e4;
}

.holi-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.holi-photo__notas {
  object-position: 86% 72%;
}

.crumb {
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.crumb a:hover {
  text-decoration: underline;
}

.ficha {
  display: grid;
  grid-template-columns: 0.765fr 1.235fr;
  gap: 28px;
  padding-bottom: 64px;
}

.ficha__cover {
  align-self: start;
  aspect-ratio: 517 / 682;
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--paper-2);
}

.ficha__cover .cover {
  height: 100%;
  min-height: 0;
}

.ficha h1 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  margin: 10px 0 8px;
}

.ficha h1 .card__con {
  font-weight: 500;
  color: var(--ink-soft);
}

.ficha .story {
  font-size: 1.45rem;
  margin: 4px 0;
}

.ficha .tags {
  margin-top: 0;
  padding-top: 4px;
}

.ficha-info {
  margin-top: 12px;
}

.ficha-info__btn {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 4px 14px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease;
}

.ficha-info__btn:hover {
  background: var(--accent-dark);
}

.ficha-info__panel {
  margin-top: 12px;
  color: var(--ink);
  font-size: 1.02rem;
  line-height: 1.55;
  text-align: justify;
}

.ficha-info__linea {
  white-space: nowrap;
}

.ficha-info__panel p {
  margin: 0 0 10px;
}

.ficha-info__panel p:last-child {
  margin-bottom: 0;
}

.ficha-info__keys {
  display: inline-block;
  white-space: nowrap;
}

.ficha-info kbd {
  display: inline-block;
  min-width: 1.55em;
  margin: 0 3px;
  padding: 1px 6px 2px;
  border: 1px solid #c8bfcc;
  border-bottom-width: 3px;
  border-radius: 6px;
  background: linear-gradient(#fff, #f4eef5);
  box-shadow: inset 0 1px 0 #fff;
  color: var(--ink);
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.86em;
  font-weight: 700;
  line-height: 1.45;
  text-align: center;
  vertical-align: 1px;
}

.ficha .story__phrase {
  color: var(--accent);
  font-weight: 600;
}

.ficha .story__meta {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  font-size: 1.2rem;
  font-weight: 500;
  line-height: 1.2;
  color: var(--ink-soft);
}

.ficha .story__acts,
.ficha .tiempo {
  font: inherit;
  color: inherit;
}

.ficha .tiempo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 14px;
}

.ficha .tiempo svg {
  width: 1.15em;
  height: 1.15em;
  flex-shrink: 0;
  color: var(--accent);
}

.ficha__intro {
  margin: 10px 0 14px;
  max-width: 32rem;
  color: var(--ink-soft);
  font-size: 1.05rem;
  line-height: 1.5;
}

.play-modes {
  display: grid;
  gap: 12px;
  margin: 24px 0 16px;
}

.play-choice {
  text-align: left;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px 18px;
  cursor: pointer;
}

.play-choice.is-on {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink) 12%, transparent);
}

.play-choice strong {
  display: block;
  font-size: 1.25rem;
  margin-bottom: 4px;
}

.play-choice p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 1.125rem;
}

.sala {
  display: none;
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: #fff;
  border: 1px dashed var(--line);
  gap: 8px;
}

.sala.is-open {
  display: grid;
}

.sala__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.sala code {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 1.15rem;
  letter-spacing: 0.08em;
  background: var(--paper);
  padding: 4px 8px;
  border-radius: 8px;
}

.hint {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--ink);
  color: #fff;
  padding: 10px 14px;
  border-radius: 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 60;
}

.toast.is-on {
  opacity: 1;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.prices {
  display: grid;
  max-width: 36rem;
  gap: 16px;
  margin-top: -70px;
}

.plan {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 24px 48px;
  align-items: center;
}

.plan .price {
  margin-bottom: 0;
}

.plan__detail {
  border-left: 1px solid var(--line);
  padding-left: 48px;
}

.plan__detail p {
  margin: 0 0 12px;
}

.panel {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 22px;
}

.panel h3 {
  margin-top: 0;
}

[data-page="holi"] .panel p {
  text-align: justify;
}

.panel a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.holi-contact {
  display: grid;
  gap: 12px;
}

.holi-contact a,
.holi-contact button {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.holi-contact button {
  background: none;
  border: 0;
  padding: 0;
  color: var(--accent);
  cursor: pointer;
  text-align: left;
}

.holi-contact a:hover,
.holi-contact button:hover {
  text-decoration: underline;
}

.holi-form {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.holi-form[hidden] {
  display: none;
}

.holi-form select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%235e574e' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 20px;
  padding-right: 36px;
}

.holi-thanks {
  margin: 12px 0 0;
  color: var(--accent);
  font-weight: 600;
}

.holi-thanks[hidden] {
  display: none;
}

.holi-form__count {
  margin: 0;
  text-align: right;
  color: var(--ink-soft);
  font-size: 0.85rem;
  font-weight: 600;
}

[data-page="holi"] .steps {
  align-items: start;
}

.holi-mascot {
  width: 180px;
  height: auto;
  margin-top: 15px;
  margin-left: 15px;
}

.holi-contact svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.price {
  font-family: var(--font);
  font-size: 3rem;
  margin: 8px 0;
}

.price span {
  font-size: 1.1rem;
  color: var(--ink-soft);
}

.libro {
  display: grid;
  grid-template-columns: minmax(280px, 460px) minmax(0, 1fr);
  gap: 28px 48px;
  align-items: start;
  padding: 48px 0 72px;
}

.libro__vista {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.libro__marco {
  position: relative;
}

.libro__portada {
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  background: #fff;
  cursor: crosshair;
  -webkit-user-drag: none;
  user-select: none;
}

.libro__lente {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  background-color: rgba(109, 179, 242, 0.38);
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.55) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.55) 1px, transparent 1px);
  background-size: 10px 10px;
  box-shadow: inset 0 0 0 1px rgba(0, 113, 194, 0.45);
}

.libro__zoom {
  position: absolute;
  top: 0;
  left: calc(100% + 12px);
  width: min(640px, calc(100vw - 520px));
  background: #fff no-repeat;
  border: 1px solid var(--line);
  z-index: 5;
  pointer-events: none;
}

.libro__muestra {
  position: absolute;
  top: 0;
  left: calc(100% + 12px);
  width: min(640px, calc(100vw - 520px));
  height: min(860px, calc(100vh - 140px));
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--line);
  z-index: 6;
}

.libro__muestra[hidden] {
  display: none !important;
}

.libro__muestra-cerrar {
  position: absolute;
  top: 11px;
  right: 24px;
  z-index: 1;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid #000;
  border-radius: 4px;
  background: #fff;
  color: #000;
  cursor: pointer;
}

.libro__muestra-cerrar::before,
.libro__muestra-cerrar::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 14px;
  height: 2px;
  background: currentColor;
  transform: translate(-50%, -50%) rotate(45deg);
}

.libro__muestra-cerrar::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.libro__muestra-cerrar:hover {
  background: #c62828;
  border-color: #c62828;
  color: #fff;
}

.libro__muestra iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.libro__minis {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.libro__minis button {
  width: 64px;
  padding: 0;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
}

.libro__minis button.is-active,
.libro__minis button:hover {
  border-color: var(--accent);
}

.libro__minis img {
  display: block;
  width: 100%;
  height: auto;
}

h1.libro__titulo {
  font-size: clamp(1.65rem, 3.75vw, 2.7rem);
  margin: 0 0 8px;
}

.libro__autor {
  margin: 0 0 16px;
  color: var(--accent);
  font-weight: 600;
}

.libro__datos {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  display: grid;
  gap: 10px;
}

.libro__datos li {
  display: flex;
  align-items: center;
  gap: 10px;
}

.libro__datos svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--accent);
}

.libro__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.form {
  display: grid;
  gap: 12px;
  max-width: 420px;
}

.form-hint {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink-soft);
  font-weight: 400;
}

.form-error {
  margin: 0;
  color: var(--b2);
  font-size: 0.95rem;
}

label {
  display: grid;
  gap: 6px;
  font-weight: 600;
  font-size: 0.95rem;
}

input,
select,
textarea {
  min-height: 48px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 0 14px;
}

input::-ms-reveal,
input::-ms-clear {
  display: none;
}

.password-field {
  position: relative;
  display: grid;
}

.password-field input {
  padding-right: 48px;
}

.password-toggle {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--ink-soft);
  cursor: pointer;
  display: grid;
  place-items: center;
}

.password-toggle svg {
  width: 20px;
  height: 20px;
}

.password-toggle:hover {
  color: var(--accent);
}

textarea {
  min-height: 120px;
  padding: 12px 14px;
  resize: vertical;
}

body[data-page="jugar"] {
  --header-h: 44px;
}

.play-header__inner {
  height: 100%;
  width: min(1376px, calc(100% - 56px));
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.play-header .brand img {
  width: 32px;
  height: 32px;
}

.play-header .brand span {
  font-size: 1.05rem;
}

.play-exit {
  color: #fff;
  font-size: 0.95rem;
  font-weight: 650;
}

.play-exit:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.exit-dialog {
  border: 0;
  border-radius: 18px;
  padding: 28px 28px 22px;
  background: var(--paper-2);
  color: var(--ink);
  box-shadow: var(--shadow);
  max-width: min(420px, calc(100% - 32px));
}

.exit-dialog::backdrop {
  background: rgba(28, 23, 20, 0.45);
}

.exit-dialog p {
  margin: 0 0 20px;
  font-size: 1.25rem;
  font-weight: 700;
}

.exit-dialog__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.exit-dialog [data-cancel]:hover {
  border-color: var(--ink);
}

.play-shell {
  min-height: calc(100vh - var(--header-h));
  display: grid;
  grid-template-rows: auto 1fr;
}

.play-sala,
.play-card {
  width: min(1376px, calc(100% - 56px));
  margin-inline: auto;
}

.play-sala {
  padding-top: 8px;
}

.play-card {
  margin-top: 16px;
  margin-bottom: 32px;
  background: var(--paper-2);
  color: var(--ink);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.play-card__head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.play-card__meta {
  flex: 1;
  min-width: 0;
}

.play-card h1 {
  margin: 0;
  color: var(--ink);
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.25;
}

.play-card h1 .card__con {
  color: var(--ink-soft);
  font-weight: 500;
}

.play-card__meta .card__acts {
  margin: 4px 0 0;
}

.play-card__credit {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink-soft);
  text-align: right;
  flex-shrink: 0;
  align-self: flex-end;
}

.play-card .badge {
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  justify-content: center;
  border-radius: 50%;
  font-size: 1rem;
  flex-shrink: 0;
}

.play-card .cover-levels {
  position: static;
  display: flex;
  gap: 8px;
}

.play-card .cover-levels .badge {
  border: 0;
}

.play-card__body {
  position: relative;
  padding: 18px;
  background: var(--paper);
}

.play-card__body::before {
  content: "";
  display: block;
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #000;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px 0 40px;
  color: var(--ink-soft);
  margin-top: 24px;
}

.site-footer__inner {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.auth-note {
  margin-top: 12px;
  font-size: 1.1rem;
}

.auth-note a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

@media (max-width: 900px) {
  .hero__stage {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .hero__art {
    order: -1;
    padding-top: 8px;
  }

  .hero__art::before {
    width: min(80%, 280px);
  }

  .hero__art::after {
    bottom: 2px;
  }

  [data-page="jueguitos2"] .hero__mascot,
  [data-page="jueguitos2"] .hero__mascot.is-obrero {
    position: static;
    display: inline-block;
    width: clamp(48px, 14vw, 72px);
    max-width: none;
    height: auto;
    margin-left: 6px;
    vertical-align: -0.35em;
  }

  [data-page="jueguitos2"] .hero__mascot,
  [data-page="jueguitos2"] .hero__mascot.is-obrero {
    width: clamp(64px, 18vw, 96px);
  }

  .libro__lente,
  .libro__zoom {
    display: none;
  }

  .libro__muestra {
    position: relative;
    top: auto;
    left: auto;
    width: 100%;
    max-width: 380px;
    height: 70vh;
    margin-top: 12px;
  }

  .hero__grid,
  .ficha,
  .levels,
  .steps,
  .grid {
    grid-template-columns: 1fr 1fr;
  }

  .libro {
    grid-template-columns: 1fr;
  }

  .libro__portada {
    max-width: 380px;
  }

  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .nav {
    display: none;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--accent-dark);
    border-bottom: 1px solid color-mix(in srgb, #000 12%, var(--accent-dark));
    padding: 12px;
    flex-direction: column;
    align-items: stretch;
  }

  .nav.is-open {
    display: flex;
  }

  [data-page="holi"] .page-head {
    grid-template-columns: 1fr;
  }

  .holi-photos {
    margin-top: 12px;
    margin-left: 0;
  }
}

@media (max-width: 640px) {
  .wrap {
    width: min(1180px, calc(100% - 24px));
  }

  .hero__grid,
  .ficha,
  .levels,
  .steps,
  .grid,
  .section__head {
    grid-template-columns: 1fr;
    display: grid;
  }

  [data-page="holi"] .page-head {
    grid-template-columns: 1fr;
  }

  .holi-photos {
    width: 440px;
    height: 507px;
    transform: scale(0.64);
    transform-origin: top left;
    margin-top: 16px;
    margin-left: 0;
    margin-bottom: -165px;
  }

  .hero__actions,
  .libro__actions,
  .sala__row {
    flex-direction: column;
    align-items: stretch;
  }

  .plan {
    grid-template-columns: 1fr;
  }

  .plan__detail {
    border: 0;
    padding-left: 0;
  }

  .btn {
    width: 100%;
  }

  .libro {
    padding-top: 28px;
    padding-bottom: 40px;
  }

  .libro__portada {
    max-width: 305px;
  }

  .nav .btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }

  .cover__spin,
  .cover--reel > img,
  [data-page="home"] .hero__mascot {
    animation: none;
  }

  .cover--reel > img {
    opacity: 0;
  }

  .cover--reel > img:first-child {
    opacity: 1;
  }
}

.card[hidden] {
  display: none;
}

.form-ok {
  max-width: 460px;
  margin: 0;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--a1);
  border-radius: 14px;
  background: var(--paper-2);
  color: var(--ink);
}

.form-ok[hidden],
.form[hidden] {
  display: none;
}
