/* Creative challenges and final responsive reading adjustments. */
.challenges-section { --scene-image:url('../assets/fantasy/creative-world.jpg'); padding:0; }
.challenges-section > .section { max-width:1280px; }
.challenge-progress { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:12px; padding:16px 20px; margin-bottom:23px; border:1px solid white; border-radius:14px; background:#ffffffed; }
.challenge-progress > span { font-size:9px; letter-spacing:1.3px; color:#9a70b2; }
.challenge-progress strong { font-size:12px; color:#69438c; }
.challenge-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:20px; }
.challenge-card {
  position: relative;
  min-width: 0;
  aspect-ratio: 500 / 602;
  background-image: url('../assets/illustrations/tarjetas-desafios.png');
  background-size: 434.4% 120.2667%;
  background-position: var(--card-x) 49.18%;
}

.color-challenge { --card-x: 1.61%; }
.shape-challenge { --card-x: 33.25%; }
.emotion-challenge { --card-x: 65%; }
.story-challenge { --card-x: 96.69%; }

.challenge-card > :not(button) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.challenge-card > button {
  position: absolute;
  inset: 8% 2% 2%;
  width: 96%;
  border-radius: 12%;
  padding: 0;
  border: 0;
  background: transparent;
  color: transparent;
}

.challenge-card > button:hover { background: #ffffff20; }
.challenge-card > button:focus-visible { outline-offset: -5px; }

.challenge-card.completed::after {
  content: '✓';
  position: absolute;
  left: 8%;
  top: 5%;
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: #def5e4;
  color: #215b3d;
  pointer-events: none;
}
.challenge-outro { display:flex; align-items:center; gap:14px; margin-top:22px; padding:19px; border-radius:16px; background:#ffffffed; border:1px solid white; flex-wrap:wrap; }
.challenge-outro p { flex:1; min-width:220px; margin:0; font-size:12px; }
.challenge-outro button[hidden] { display:none; }
.challenge-note { font-size:10px; color:#81718d; margin:15px 0 0; text-align:center; }
#challenge-dialog {
  --theme-ink: #301184;
  --theme-tint: #e7d5fd;
  --theme-wash: #f3e8ff;
  --theme-border: #b38af4;
  --strip-x: 12.1%;
  --strip-y: 12.4%;
  max-width: 736px;
  padding: 18px clamp(22px, 4vw, 48px) 24px;
  border: 2px solid #fff;
  border-radius: 32px;
  background:
    radial-gradient(ellipse 230px 98px at 104% -5%, #794dbd 69%, #ad86e9 70% 85%, #e4d1fc 86% 99%, transparent),
    radial-gradient(ellipse 340px 95px at 106% 111%, #7d50c3 69%, #b897ef 70% 85%, #e4d4fa 86% 99%, transparent),
    radial-gradient(ellipse 100px 120px at -9% 111%, #8e6bcf 69%, #c1a4ef 70% 85%, #e6d6fb 86% 99%, transparent),
    #fbf7ff;
  box-shadow: 0 0 0 1px #a983eb, 0 11px 31px #6b36b87a;
}

#challenge-dialog[data-theme="shapes"] { --strip-x: 90.1%; --strip-y: 12.5%; }
#challenge-dialog[data-theme="theater"] { --strip-x: 11.2%; --strip-y: 66.9%; }
#challenge-dialog[data-theme="garden"] { --strip-x: 89.9%; --strip-y: 66.9%; }

#challenge-dialog .dialog-header { margin-bottom: 12px; }
#challenge-dialog .eyebrow {
  margin: 0;
  padding: 0;
  background: transparent;
  color: #1d1059;
  font-size: clamp(11px, 2vw, 15px);
  font-weight: 800;
  letter-spacing: .1px;
  box-shadow: none;
  border: 0;
}

#challenge-dialog .close-button {
  display: grid;
  place-items: center;
  background: #fbf8ff;
  color: #361096;
  box-shadow: 0 3px 9px #391a7180;
  font-size: 29px;
}

.challenge-visual {
  width: 91%;
  aspect-ratio: 575 / 108;
  margin: 0 auto 17px;
  border-radius: clamp(13px, 3vw, 28px);
  background: #ebdffb url('../assets/illustrations/Contenido%20de%20tarjetas%20de%20cada%20una.png') var(--strip-x) var(--strip-y) / 267% 948%;
}
#challenge-title { font-size:29px; letter-spacing:-.8px; line-height:1.2; margin:0 0 17px; }
#challenge-question { font-size:15px; color:#514364; line-height:1.8; margin-bottom:22px; }
#challenge-options { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:11px; }
.challenge-answer { border:1px solid var(--theme-border); padding:16px 10px; min-height:54px; background:var(--theme-tint); color:var(--theme-ink); border-radius:22px; font-size:15px; font-weight:600; box-shadow: inset 0 0 0 1px #ffffffb5, 0 4px 9px #8054b629; }
.challenge-answer:hover:not(:disabled) { background:var(--theme-tint); }
.challenge-answer.correct { border-color:#8eb88c; background:#e6f1e1; color:#47744d; }
.challenge-answer.try-again { background:#f2edf3; color:#9c8aab; }
#challenge-feedback { margin-top:19px; padding:16px 19px; border-radius:13px; line-height:1.8; font-size:13px; }
#challenge-feedback[hidden] { display:none; }
.feedback-success { background:#ecf4e6; color:#526c48; border:1px solid #cfe0c6; }
.feedback-retry { background:#fff4de; color:#8a7146; border:1px solid #ebdbb5; }
.challenge-dialog-actions { display:flex; justify-content:space-between; flex-wrap:wrap; gap:12px; margin-top:23px; }
#challenge-dialog .challenge-dialog-actions .info-button { background:var(--theme-wash); border-color:var(--theme-border); color:var(--theme-ink); border-radius:24px; box-shadow:0 4px 10px #8054b62e; }
.challenge-dialog-actions button[hidden] { display:none; }
.hero-copy,.section-heading,.world-card,.learning-grid article,.team-info,.challenge-card { min-width:0; }
.hero h1,h2,h3,h4,p,button,a { overflow-wrap:break-word; }
@media(max-width:1100px) { .challenge-grid { gap:14px; }  }
@media(max-width:800px) {
 .challenge-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
 .hero-copy { background:#fffafff5; border:1px solid white; padding:25px; border-radius:23px; }
 .hero::before { background:#fff4; }
 .section-heading { background:#fffafff5; border:1px solid white; border-radius:21px; padding:23px; }
 .section-heading > p { max-width:none; color:#4e4360; text-shadow:none; }
 .team-section .section-heading { margin-bottom:27px; }
 .section-scene h2,.hero h1 { text-shadow:none; }
 .hero h1 { font-size:48px; line-height:1.12; }
 .hero h1 br { display:none; }
 .hero h1 .hero-spark { font-size:30px; }
 .hero-copy > p { max-width:none; font-size:14px; text-shadow:none; color:#4e4360; }
 .world-card h3 { font-size:29px; }
 .world-card p { font-size:13px; }
 .team-info h3 { overflow-wrap:normal; }
 .gallery-section .section-heading { margin-inline:23px; padding:23px; }
 .experience-heading,.experience-list,.keepsake-copy { background:#fffafffa; }
 .experience-list p,.learning-grid p { font-size:13px; }
 .learning-grid h4 { font-size:15px; }
 .learning-heading p { font-size:13px; }
 .finale-copy p { font-size:14px; }
 .hero-actions { display:flex; flex-wrap:wrap; }
 .hero-actions a { flex:1 1 160px; white-space:normal; }
}
@media(max-width:560px) {
 .hero-inner { padding:25px 18px 35px; }
 .hero-copy { padding:23px 20px; }
 .hero h1 { font-size:clamp(34px,9vw,42px); letter-spacing:-1.6px; line-height:1.14; }
 .hero-copy > p { font-size:14px; line-height:1.85; margin-top:20px; }
 .hero-actions { display:grid; grid-template-columns:1fr; gap:10px; }
 .hero-actions .button,.hero-actions .link-button { font-size:12px; min-height:47px; padding:13px 16px; }
 .hero .badge { font-size:7px; letter-spacing:.7px; line-height:1.7; max-width:100%; }
 .section-heading { padding:21px 19px; }
 .section-heading h2,.experience-heading h2,.team-section h2 { font-size:29px; line-height:1.2; letter-spacing:-1px; }
 .section-heading > p { font-size:13px; line-height:1.85; }
 .section-heading .eyebrow { font-size:7px; letter-spacing:.8px; line-height:1.7; white-space:normal; }
 .gallery-section .section-heading { margin-inline:18px; padding:21px 19px; }
 .world-card { display:grid; grid-template-columns:minmax(0,1fr) 76px; gap:0 10px; padding:24px 21px; }
 .world-card .world-illustration { position:static; grid-column:2; grid-row:2; align-self:center; width:76px; height:95px; margin:0; }
 .world-card-top { grid-column:1/-1; grid-row:1; }
 .world-card h3 { grid-column:1; grid-row:2; font-size:24px; line-height:1.25; margin:20px 0 16px; padding:0; max-width:none; min-height:0; }
 .world-card h3 br { display:none; }
 .world-card p { grid-column:1/-1; grid-row:3; max-width:none; font-size:13px; line-height:1.85; margin:0; padding:0; min-height:0; }
 .world-card .chips { grid-column:1/-1; grid-row:4; padding:0; margin:19px 0; }
 .world-card .chips span { font-size:10px; padding:6px 9px; }
 .world-card .world-link { grid-column:1/-1; grid-row:5; min-height:44px; font-size:12px; }
 .world-card-top > span:nth-child(2) { font-size:7px; letter-spacing:.8px; }
 .world-card .world-arrow { margin-left:auto; }
 .experience-list article { align-items:flex-start; }
 .experience-list article > div { min-width:0; }
 .experience-list h3 { font-size:16px; line-height:1.35; }
 .experience-list p { font-size:13px; line-height:1.8; }
 .experience-heading p { font-size:13px; }
 .info-button,.gallery-discover .info-button { font-size:12px; min-height:44px; }
 .gallery-discover > span { font-size:8px; line-height:1.7; }
 .carousel-description { font-size:12px; line-height:1.8; }
 .showcase-carousel .carousel-title { font-size:21px; line-height:1.3; }
 .team-info h3 { font-size:19px; line-height:1.4; }
 .team-info > span { font-size:11px; }
 .team-card { grid-template-columns:80px minmax(0,1fr); }
 .team-info { padding:20px 16px; }
 .avatar { width:58px; height:58px; font-size:25px; }
 .finale-copy h2 { font-size:30px; line-height:1.2; }
 .finale-copy p { font-size:13px; line-height:1.85; }
 .finale-copy .eyebrow { font-size:7px; letter-spacing:.7px; line-height:1.7; }
 .finale-copy .button { font-size:11px; white-space:normal; line-height:1.6; }
 .learning-grid { grid-template-columns:1fr; gap:14px; }
 .learning-grid article { padding:20px; }
 .learning-grid h4 { font-size:17px; }
 .learning-grid p { font-size:13px; line-height:1.85; }
 .learning-more { font-size:12px; min-height:42px; }
 .save-section h3 { font-size:29px; }
 .save-section p { font-size:13px; line-height:1.85; }
 .keepsake-copy small { font-size:11px; line-height:1.8; }
 .keepsake-copy .text-info { font-size:12px; }
 .challenge-grid { grid-template-columns:minmax(0, 380px); justify-content:center; gap:17px; }
 .challenge-progress { padding:16px; }
 .challenge-progress > span { font-size:8px; line-height:1.7; }
 .challenge-progress strong { font-size:12px; }
 .challenge-outro { padding:18px; }
 .challenge-outro p { min-width:0; flex-basis:100%; font-size:13px; }
 .challenge-outro .info-button { width:100%; }
 .challenge-note { font-size:11px; padding-inline:8px; line-height:1.8; }
 .footer-main { grid-template-columns:1fr; gap:25px; }
 .footer-brand { grid-column:auto; }
 .footer-nav a,.footer-message p,.footer-brand p { font-size:12px; line-height:1.8; }
 .footer-nav > span,.footer-message > span { font-size:9px; }
 .footer-bottom { font-size:10px; flex-direction:column; gap:7px; }
 .footer-bottom > span:last-child { text-align:left; }
 dialog { max-width:calc(100vw - 20px); max-height:92dvh; }
 #challenge-dialog { padding:23px; }
 #challenge-title { font-size:26px; }
 #challenge-question { font-size:14px; }
 #challenge-options { grid-template-columns:1fr; }
 .challenge-answer { font-size:14px; min-height:47px; }
 .challenge-visual { font-size:33px; padding:18px 10px; }
 .challenge-dialog-actions { flex-direction:column; align-items:stretch; }
 .challenge-dialog-actions .button,.challenge-dialog-actions .info-button { font-size:12px; }
 #information-list li > span,#world-lessons li > span { font-size:13px; line-height:1.85; }
 #information-intro,#world-intro { font-size:13px; }
}
@media(prefers-reduced-motion:reduce) { .challenge-card { transition:none; } }
/* Give artwork its own column at every size, never over the reading area. */
.world-card { display:grid; grid-template-columns:minmax(0,1fr) 130px; gap:0 18px; }
.world-card-top { grid-column:1/-1; grid-row:1; }
.world-card .world-illustration { position:static; grid-column:2; grid-row:2/4; align-self:center; width:130px; height:170px; margin:0; }
.world-card h3 { grid-column:1; grid-row:2; max-width:none; min-height:0; padding:0; }
.world-card p { grid-column:1; grid-row:3; max-width:none; min-height:0; padding:0; }
.world-card .chips { grid-column:1/-1; grid-row:4; }
.world-card .world-link { grid-column:1/-1; grid-row:5; }
@media(max-width:560px) {
 .world-card { grid-template-columns:minmax(0,1fr) 76px; column-gap:10px; }
 .world-card .world-illustration { grid-row:2; width:76px; height:95px; }
 .world-card p { grid-column:1/-1; }
}

/* The supplied artwork defines the panel. Real buttons sit over its actions. */
#aprendizaje {
  --learning-art: url('../assets/illustrations/Otras.png');
}

#aprendizaje .learning-more > span { pointer-events: none; }

@media (min-width: 901px) {
  #aprendizaje {
    position: relative;
    aspect-ratio: 1832 / 858;
    padding: 0;
    border: 0;
    background: var(--learning-art) center / 100% 100% no-repeat;
    box-shadow: none;
  }

  #aprendizaje .learning-heading { opacity: 0; margin: 0; }
  #aprendizaje .learning-grid {
    position: absolute;
    inset: 35% 3.05% 14.5% 3.55%;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.05%;
  }

  #aprendizaje .learning-grid article {
    position: relative;
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  #aprendizaje .learning-grid article > :not(button) { opacity: 0; }
  #aprendizaje .learning-more {
    position: absolute;
    inset: 77.5% 15% 5%;
    width: 70%;
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 99px;
    color: transparent;
    background: transparent;
  }
  #aprendizaje .learning-more > span { color: transparent; }
  #aprendizaje .learning-more:hover { background: #ffffff35; }
  #aprendizaje .learning-more:focus-visible { outline-offset: 2px; }
}

@media (max-width: 900px) {
  #aprendizaje .learning-symbol {
    width: 140px;
    max-width: 100%;
    height: 82px;
    margin: 0 auto 10px;
    color: transparent;
    background: var(--learning-art) var(--learning-x) 47.2% / 648% 553% no-repeat;
    border-radius: 12px;
  }

  #aprendizaje .learning-symbol.colors { --learning-x: 7.9%; }
  #aprendizaje .learning-symbol.shapes { --learning-x: 35.7%; }
  #aprendizaje .learning-symbol.emotions { --learning-x: 63.9%; }
  #aprendizaje .learning-symbol.stories { --learning-x: 91.5%; }

  #aprendizaje .learning-more {
    justify-content: center;
    gap: 14px;
    min-height: 44px;
    border: 0;
    border-radius: 99px;
    background: #e9dcfa;
  }
}


#information-dialog.learning-information {
  position: fixed;
  isolation: isolate;
  max-width: 940px;
  padding: clamp(18px, 3vw, 34px);
  border: 2px solid white;
  border-radius: 34px;
  background:
    radial-gradient(ellipse 240px 110px at 100% -5%, #9b75e8 45%, #c7acf3 64%, #eee2ff 81%, transparent 82%),
    radial-gradient(ellipse 340px 118px at 110% 115%, #a688ea 57%, #e7d9fa 75%, transparent 76%),
    #faf6ff;
  box-shadow: 0 0 0 1px #b294f0, 0 12px 34px #6a43b76b;
}

#information-dialog.learning-information::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  z-index: -1;
  width: min(28%, 223px);
  aspect-ratio: 223 / 111;
  background: url('../assets/illustrations/Dise%C3%B1os.png') 1.98% 41.85% / 688.8% 922.5% no-repeat;
  border-bottom-left-radius: 31px;
  pointer-events: none;
}

.learning-information .dialog-header .eyebrow {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #21106d;
  box-shadow: none;
  font-size: 12px;
  font-weight: 800;
}

.learning-information .close-button {
  background: #f9f4ff;
  color: #381192;
  box-shadow: 0 4px 10px #6333b450;
}

.learning-information #information-title {
  color: #170b55;
  font-size: clamp(22px, 2.7vw, 30px);
  line-height: 1.12;
  margin-bottom: 12px;
}

.learning-information #information-image {
  aspect-ratio: 1.42;
  object-fit: cover;
}

.learning-information #information-intro,
.learning-information #information-list li > span {
  color: #322362;
  line-height: 1.55;
}

.learning-information #information-list li { border-color: #e7d9f7; }
.learning-information #information-list strong { color: #5922bf; }

#information-dialog.learning-information > .button {
  min-height: 48px;
  align-items: center;
  gap: 13px;
  border: 2px solid white;
  border-radius: 999px;
  background: linear-gradient(115deg, #7045f7, #5925dd 73%, #951df5);
  color: white;
  box-shadow: 0 3px 14px #743cdb80, inset 0 0 7px #ffffff95;
}
