.levels-page {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  padding: 36px 24px 60px;
  background: linear-gradient(180deg, #fff8ea 0%, #fff1d7 100%);
}

.levels-page__container {
  position: relative;
  z-index: 2;
  max-width: 1280px;
  margin: 0 auto;
}

/* Fondo decorativo */
.levels-page__pattern,
.levels-page__cloud,
.levels-page__blob,
.levels-page__star {
  position: absolute;
  pointer-events: none;
  user-select: none;
  z-index: 1;
}

.levels-page__pattern {
  inset: 0;
  background-repeat: repeat;
}

.levels-page__pattern--confetti {
  background-image: url("../assets/img/decoracion/confeti.png");
  background-size: 220px;
  opacity: 0.08;
}

.levels-page__pattern--dots {
  background-image: url("../assets/img/decoracion/puntos-decorativos.png");
  background-size: 250px;
  opacity: 0.14;
}

.levels-page__particles {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-image:
    radial-gradient(circle, rgba(184, 220, 174, 0.55) 3px, transparent 3.5px),
    radial-gradient(circle, rgba(242, 213, 126, 0.55) 3px, transparent 3.5px);
  background-size: 92px 92px, 118px 118px;
  background-position: 0 0, 40px 45px;
  animation: moverParticulasLevels 14s linear infinite;
}

@keyframes moverParticulasLevels {
  from {
    background-position: 0 0, 40px 45px;
  }

  to {
    background-position: 92px 92px, 158px 163px;
  }
}

/* Adornos */
.levels-page__cloud--one {
  width: 145px;
  top: 18px;
  left: 18px;
  opacity: 0.95;
}

.levels-page__cloud--two {
  width: 145px;
  top: 18px;
  right: 18px;
  opacity: 0.95;
}

.levels-page__blob--green {
  width: 170px;
  left: -45px;
  bottom: 38px;
  opacity: 0.75;
}

.levels-page__blob--yellow {
  width: 180px;
  right: -45px;
  bottom: 40px;
  opacity: 0.78;
}

.levels-page__star--one {
  width: 48px;
  left: 40px;
  top: 240px;
  opacity: 0.95;
}

.levels-page__star--two {
  width: 48px;
  right: 40px;
  top: 240px;
  opacity: 0.95;
}

/* Botón volver */
.levels-page__back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 22px;
  padding: 10px 18px;
  border-radius: 999px;
  background: #ffffff;
  color: #285b97;
  text-decoration: none;
  font-weight: 800;
  box-shadow: 0 8px 20px rgba(50, 70, 90, 0.1);
}

/* Encabezado */
.levels-header {
  text-align: center;
  margin-bottom: 34px;
}

.levels-header__badge {
  display: inline-block;
  margin-bottom: 12px;
  padding: 10px 18px;
  border-radius: 999px;
  background: #ffffff;
  font-weight: 800;
  box-shadow: 0 8px 20px rgba(50, 70, 90, 0.08);
}

.levels-header__title {
  margin: 0 0 10px;
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1.1;
  font-weight: 900;
}

.levels-header__text {
  max-width: 650px;
  margin: 0 auto;
  font-size: 1.15rem;
  line-height: 1.5;
  color: #5d6d82;
}

/* Grid */
.levels-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(290px, 1fr));
  gap: 28px;
}

/* Tarjeta base */
.level-card {
  --accent: #4a96f0;
  --accent-dark: #163f73;
  --accent-soft: #eaf4ff;
  --accent-border: rgba(74, 150, 240, 0.28);

  display: flex;
  flex-direction: column;
  min-height: 100%;
  background: #ffffff;
  border-radius: 34px;
  overflow: hidden;
  border: 3px solid rgba(255, 255, 255, 0.88);
  box-shadow: 0 18px 36px rgba(111, 85, 42, 0.12);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.level-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 22px 42px rgba(111, 85, 42, 0.18);
}

.level-card__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  min-height: 200px;
  padding: 26px;
  background: linear-gradient(180deg, var(--accent-soft) 0%, #fff8e8 100%);
  border-bottom: 2px solid rgba(220, 202, 165, 0.35);
}

.level-card__sign-box {
  position: relative;
  width: 138px;
  height: 138px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 30px;
  background: #ffffff;
  box-shadow: 0 14px 28px rgba(90, 70, 40, 0.12);
  overflow: hidden;
  border: 3px solid var(--accent-border);
}

.level-card__sign {
  width: 82%;
  height: 82%;
  object-fit: contain;
}

.level-card__number {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--accent);
  color: #ffffff;
  font-size: 1.15rem;
  font-weight: 900;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
}

.level-card__difficulty {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  padding: 12px 18px;
  border-radius: 999px;
  background: #ffffff;
  color: #69758c;
  font-size: 1.05rem;
  font-weight: 800;
  box-shadow: 0 8px 20px rgba(60, 70, 80, 0.08);
  border: 2px solid rgba(0, 0, 0, 0.04);
}

.level-card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 24px 26px 28px;
}

.level-card__title {
  margin: 0 0 14px;
  font-size: 1.22rem;
  line-height: 1.25;
  color: var(--accent-dark);
  font-weight: 900;
}

.level-card__description {
  margin: 0 0 20px;
  font-size: 1.02rem;
  line-height: 1.55;
  color: #5f6f84;
}

.level-card__completed-text {
  margin: 0 0 18px;
  font-size: 0.96rem;
  font-weight: 800;
  color: var(--accent);
}

.level-card__button {
  margin-top: auto;
  border: none;
  border-radius: 999px;
  padding: 16px 18px;
  background: var(--accent);
  color: #ffffff;
  font-size: 1.08rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.18s ease, filter 0.18s ease;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.08);
}

.level-card__button:hover:not(:disabled) {
  transform: translateY(-2px);
  filter: brightness(1.04);
}

.level-card__button:disabled {
  background: #d8d8d8;
  cursor: not-allowed;
  opacity: 0.95;
  box-shadow: none;
}

.level-card--locked {
  opacity: 0.82;
}

.level-card--completed {
  box-shadow: 0 18px 36px rgba(111, 85, 42, 0.16);
}

/* Juego 1: azul */
.levels-page--azul .levels-header__badge {
  color: #3b9cff;
}

.levels-page--azul .levels-header__title {
  color: #163f73;
}

.level-card--azul {
  --accent: #3b9cff;
  --accent-dark: #163f73;
  --accent-soft: #eaf5ff;
  --accent-border: rgba(59, 156, 255, 0.35);
}

/* Juego 2: morado */
.levels-page--morado .levels-header__badge {
  color: #9b63eb;
}

.levels-page--morado .levels-header__title {
  color: #56328f;
}

.level-card--morado {
  --accent: #9b63eb;
  --accent-dark: #56328f;
  --accent-soft: #f1e8ff;
  --accent-border: rgba(155, 99, 235, 0.35);
}

/* Juego 3: verde */
.levels-page--verde .levels-header__badge {
  color: #62c853;
}

.levels-page--verde .levels-header__title {
  color: #2f7a33;
}

.level-card--verde {
  --accent: #62c853;
  --accent-dark: #2f7a33;
  --accent-soft: #eaf9e7;
  --accent-border: rgba(98, 200, 83, 0.35);
}

/* Juegos futuros */
.level-card--amarillo {
  --accent: #f2b233;
  --accent-dark: #9b6b00;
  --accent-soft: #fff4d8;
  --accent-border: rgba(242, 178, 51, 0.35);
}

.level-card--rosado {
  --accent: #f471a3;
  --accent-dark: #a83d6a;
  --accent-soft: #ffe7f1;
  --accent-border: rgba(244, 113, 163, 0.35);
}

/* Estado vacío */
.levels-empty {
  max-width: 520px;
  margin: 80px auto 0;
  padding: 36px 28px;
  border-radius: 28px;
  background: #ffffff;
  text-align: center;
  box-shadow: 0 18px 36px rgba(111, 85, 42, 0.1);
}

.levels-empty__title {
  margin: 0 0 12px;
  color: #163a63;
  font-size: 1.8rem;
}

.levels-empty__text {
  margin: 0;
  color: #5d6c82;
  line-height: 1.5;
}
/* Tutorial del juego */
.levels-tutorial-card {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(320px, 1.1fr);
  align-items: center;
  gap: 28px;
  margin: -8px auto 34px;
  padding: 24px;
  border-radius: 34px;
  background: rgba(255, 255, 255, 0.92);
  border: 3px solid rgba(255, 255, 255, 0.88);
  box-shadow: 0 18px 36px rgba(111, 85, 42, 0.12);
}

.levels-tutorial-card__content {
  padding: 6px 4px;
}

.levels-tutorial-card__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 9px 16px;
  border-radius: 999px;
  background: #fff4d8;
  color: #9b6b00;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(90, 70, 40, 0.08);
}

.levels-tutorial-card__badge::before {
  content: "🎬";
}

.levels-tutorial-card__title {
  margin: 0 0 10px;
  color: #163a63;
  font-size: clamp(1.35rem, 2.4vw, 2rem);
  line-height: 1.15;
  font-weight: 1000;
}

.levels-tutorial-card__text {
  margin: 0;
  color: #5d6d82;
  font-size: 1.08rem;
  line-height: 1.5;
  font-weight: 700;
}

.levels-tutorial-card__video-box {
  overflow: hidden;
  border-radius: 28px;
  background: #10265f;
  box-shadow: 0 14px 28px rgba(16, 38, 95, 0.18);
  border: 4px solid #ffffff;
}

.levels-tutorial-card__video {
  display: block;
  width: 100%;
  max-height: 360px;
  background: #10265f;
}

@media (max-width: 900px) {
  .levels-tutorial-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .levels-tutorial-card {
    padding: 18px;
    border-radius: 26px;
  }

  .levels-tutorial-card__video-box {
    border-radius: 22px;
  }
}
