:root {
  --bg: #f5f9ff;
  --white: #ffffff;
  --text: #12315e;
  --muted: #587aa7;
  --primary: #2287f0;
  --primary-dark: #0d4eb3;
  --primary-deep: #082b75;
  --accent: #ffb300;
  --accent-soft: #ffd765;
  --line: #cfe2ff;
  --shadow: 0 18px 45px rgba(24, 84, 167, 0.16);
  --radius-lg: 28px;
  --radius-md: 20px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top left, #ffffff 0%, #f5f9ff 40%, #edf5ff 100%);
}
body.menu-open { overflow: hidden; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
.container { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 1.5rem; font-weight: 900; letter-spacing: .02em; color: var(--primary-deep);
}
.brand-mark { display: inline-flex; align-items: center; gap: 10px; flex-wrap: nowrap; }
.brand-mascot { width: 36px; height: 36px; object-fit: contain; filter: drop-shadow(0 5px 10px rgba(13,78,179,.2)); }
.hero-panel .brand-mascot { width: 60px; height: 60px; }
.footer .brand-mascot { width: 28px; height: 28px; }
.brand-home-image {
  width: 66px;
  height: 66px;
  padding: 6px;
  line-height: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 3px solid var(--primary);
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 10px 22px rgba(13,78,179,.16);
  overflow: hidden;
  flex-shrink: 0;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.home-brand-img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}
.brand-home-image:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 14px 26px rgba(13,78,179,.22);
  border-color: var(--primary-dark);
}
@media (max-width: 720px) {
  .brand-home-image {
    width: 58px;
    height: 58px;
    padding: 5px;
  }
  .home-brand-img {
    width: 38px;
    height: 38px;
  }
}

.navbar { display: flex; align-items: center; justify-content: space-between; padding: 24px 0; position: relative; z-index: 30; }
.nav-links { display: flex; gap: 24px; align-items: center; }
.nav-links a { font-weight: 700; color: var(--primary-dark); opacity: .95; }
.hamburger {
  display: none; width: 46px; height: 46px; border: 1px solid var(--line);
  background: rgba(255,255,255,.9); border-radius: 14px; cursor: pointer; box-shadow: 0 10px 24px rgba(24,84,167,.12);
}
.hamburger span { display: block; width: 22px; height: 3px; background: var(--primary-deep); border-radius: 999px; margin: 5px auto; transition: .25s ease; }
.hamburger.is-open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.hamburger.is-open span:nth-child(2) { opacity: 0; }
.hamburger.is-open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
.mobile-overlay { position: fixed; inset: 0; background: rgba(8,43,117,.22); opacity: 0; pointer-events: none; transition: .25s ease; z-index: 20; }
.mobile-overlay.is-active { opacity: 1; pointer-events: auto; }
.hero {
  min-height: 100vh; position: relative; overflow: hidden;
  background: radial-gradient(circle at 15% 20%, rgba(255,214,101,.24), transparent 22%), radial-gradient(circle at 85% 24%, rgba(34,135,240,.16), transparent 18%), linear-gradient(180deg, #ffffff 0%, #eef5ff 100%);
}
.hero::before {
  content: ''; position: absolute; inset: auto -10% -24% -10%; height: 54%;
  background: radial-gradient(circle at center, rgba(34,135,240,.10), rgba(34,135,240,.03) 55%, transparent 70%);
  pointer-events: none;
}
.hero-inner {
  display: grid; grid-template-columns: 1.02fr .98fr; align-items: center; gap: 24px;
  min-height: calc(100vh - 120px); padding: 18px 0 30px; position: relative; z-index: 2;
}
.hero-copy { position: relative; }
.hero-visual { display: flex; justify-content: center; }
.pill, .eyebrow {
  display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: rgba(255,255,255,.8);
  color: var(--primary-dark); font-weight: 700; padding: 10px 16px; border-radius: 999px; box-shadow: var(--shadow);
}
.eyebrow { margin-bottom: 14px; }
.hero-panel {
  margin-top: 18px; padding: 36px 34px; border-radius: 32px; background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,255,255,.74));
  box-shadow: var(--shadow); border: 1px solid rgba(207,226,255,.8); backdrop-filter: blur(10px); position: relative;
}
.hero-badge { position: absolute; top: -14px; right: 22px; background: var(--accent); color: #7a4a00; padding: 8px 14px; border-radius: 999px; font-weight: 900; box-shadow: var(--shadow); }
.hero-panel h1 { margin: 0; font-size: clamp(3rem, 7vw, 5rem); line-height: 1; color: var(--primary-deep); letter-spacing: .02em; }
.subtitle { margin: 16px 0 0; max-width: 560px; font-size: 1.12rem; line-height: 1.68; color: var(--muted); text-align: justify; }
.hero-actions { display: flex; gap: 16px; margin-top: 28px; flex-wrap: wrap; }
.btn { padding: 14px 22px; border-radius: 999px; font-weight: 800; transition: transform .2s ease, box-shadow .2s ease; }
.btn:hover { transform: translateY(-2px); }
.btn-primary { color: white; background: linear-gradient(135deg, var(--primary), var(--primary-dark)); box-shadow: var(--shadow); }
.avatar-showcase {
  position: relative; width: min(520px, 100%); aspect-ratio: 1 / 1; border-radius: 40px; background: linear-gradient(180deg, rgba(255,255,255,.85), rgba(232,243,255,.8));
  border: 1px solid var(--line); box-shadow: var(--shadow); display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.avatar-showcase::before {
  content: ''; position: absolute; width: 80%; height: 80%; border-radius: 50%; background: radial-gradient(circle, rgba(34,135,240,.14), rgba(34,135,240,.03) 65%, transparent 70%);
}
.hero-mascot { position: relative; z-index: 2; filter: drop-shadow(0 18px 30px rgba(15,71,155,.22)); }
.hero-mascot-classroom { width: 96%; transform: translateY(10px); }
.spark { position: absolute; border-radius: 50%; z-index: 1; animation: floatUp 5.5s ease-in-out infinite; }
.spark-1 { width: 18px; height: 18px; background: var(--accent); top: 14%; left: 12%; animation-delay: .2s; }
.spark-2 { width: 12px; height: 12px; background: #60b0ff; top: 22%; right: 14%; animation-delay: .8s; }
.spark-3 { width: 20px; height: 20px; background: rgba(34,135,240,.18); bottom: 15%; left: 18%; animation-delay: 1.4s; }
.spark-4 { width: 14px; height: 14px; background: var(--accent-soft); bottom: 22%; right: 20%; animation-delay: 2.1s; }
.floating-shape, .floating-icon, .course-float { position: absolute; z-index: 1; pointer-events: none; }
.floating-shape, .course-float { border-radius: 50%; filter: blur(1px); opacity: .74; animation: drift 9s ease-in-out infinite; }
.shape-1 { width: 140px; height: 140px; background: rgba(34,135,240,.11); top: 14%; left: -30px; }
.shape-2 { width: 90px; height: 90px; background: rgba(255,179,0,.18); top: 22%; right: 8%; animation-delay: 1s; }
.shape-3 { width: 180px; height: 180px; background: rgba(128,197,255,.12); bottom: 8%; right: -50px; animation-delay: 2s; }
.floating-icon { font-size: 2rem; animation: drift 8s ease-in-out infinite; }
.icon-book { top: 18%; left: 10%; animation-delay: .3s; }
.icon-pencil { top: 12%; right: 20%; animation-delay: 1.3s; }
.icon-bulb { bottom: 26%; left: 7%; animation-delay: 2s; }
.icon-formula { bottom: 18%; right: 12%; animation-delay: 1.6s; color: var(--primary-dark); font-weight: 900; }
.mini-marquee { position: relative; overflow: hidden; width: 100%; z-index: 2; border-top: 1px solid rgba(207,226,255,.7); border-bottom: 1px solid rgba(207,226,255,.7); background: rgba(255,255,255,.6); }
.mini-marquee-track { display: flex; gap: 18px; width: max-content; padding: 16px 0; animation: marquee 24s linear infinite; }
.mini-marquee-track span {
  display: inline-flex; align-items: center; gap: 8px; background: white; color: var(--primary-dark); border: 1px solid var(--line);
  padding: 10px 16px; border-radius: 999px; font-weight: 800; box-shadow: 0 8px 18px rgba(24,84,167,.10);
}
.mini-marquee-track span::before { content: '★'; color: var(--accent); }
.section { padding: 88px 0; }
.section-heading { text-align: center; max-width: 780px; margin: 0 auto 42px; }
.section-heading h2, .course-center h1 { margin: 6px 0 8px; font-size: clamp(1.55rem, 3vw, 2.25rem); color: var(--primary-deep); }
.level-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.level-card {
  padding: 28px; border-radius: var(--radius-lg); background: linear-gradient(180deg, rgba(255,255,255,.95), rgba(245,249,255,.86)); border: 1px solid var(--line); box-shadow: var(--shadow);
  position: relative; overflow: hidden; min-height: 230px; transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.level-card::after { content: ''; position: absolute; inset: auto -50px -50px auto; width: 140px; height: 140px; background: radial-gradient(circle, rgba(34,135,240,.18), transparent 65%); }
.level-card:hover { transform: translateY(-8px); box-shadow: 0 22px 48px rgba(24,84,167,.22); border-color: #a8cfff; }
.level-card h3 { margin: 0 0 12px; font-size: 1.8rem; color: var(--primary-deep); }
.level-card p { color: var(--muted); margin: 0 0 32px; line-height: 1.6; }
.level-link { display: inline-flex; align-items: center; justify-content: center; min-width: 104px; padding: 11px 18px; color: white; background: linear-gradient(135deg, var(--primary), var(--primary-dark)); border-radius: 999px; font-weight: 900; box-shadow: 0 12px 24px rgba(34,135,240,.25); position: relative; z-index: 2; }
.footer { padding: 24px 0 34px; border-top: 1px solid rgba(207,226,255,.7); background: linear-gradient(180deg, rgba(255,255,255,.4), rgba(238,245,255,.95)); }
.footer-inner { display: flex; justify-content: space-between; gap: 16px; align-items: center; color: var(--muted); }
.footer-inner a { font-weight: 800; color: var(--primary-dark); }
.course-hero { min-height: auto; padding-bottom: 24px; }
.course-header { position: relative; padding: 24px 0 10px; }
.course-center {
  max-width: 560px; margin: 0 auto; text-align: center; padding: 20px 22px; border-radius: 22px;
  background: linear-gradient(180deg, rgba(255,255,255,.95), rgba(240,247,255,.88)); border: 1px solid var(--line); box-shadow: var(--shadow); position: relative; z-index: 2;
}
.course-center p { color: var(--muted); line-height: 1.45; max-width: 500px; margin: 0 auto 8px; }
.course-float-1 { width: 140px; height: 140px; background: rgba(255,179,0,.16); top: 30px; left: 7%; }
.course-float-2 { width: 180px; height: 180px; background: rgba(34,135,240,.12); top: 90px; right: 5%; animation-delay: 1s; }
.course-float-3 { width: 90px; height: 90px; background: rgba(128,197,255,.18); bottom: 0; left: 18%; animation-delay: 2s; }
.course-icon { position: absolute; font-size: 2rem; z-index: 1; animation: drift 8s ease-in-out infinite; pointer-events: none; }
.course-icon-1 { top: 44px; left: 12%; }
.course-icon-2 { top: 80px; right: 12%; animation-delay: .8s; }
.course-icon-3 { bottom: 10px; right: 18%; animation-delay: 1.4s; }
.subjects-wrap { display: grid; grid-template-columns: repeat(2,1fr); gap: 22px; }
.subject-card { background: linear-gradient(180deg, rgba(255,255,255,.95), rgba(246,250,255,.85)); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow); padding: 24px; }
.subject-top { display: grid; grid-template-columns: 1fr 150px; gap: 18px; align-items: center; margin-bottom: 18px; }
.subject-copy h3 { margin: 0 0 10px; font-size: 1.35rem; color: var(--primary-deep); }
.subject-copy p { color: var(--muted); margin: 0; }
.subject-thumb { width: 100%; max-width: 150px; margin-left: auto; filter: drop-shadow(0 12px 20px rgba(15,71,155,.14)); }
.subject-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.subject-btn { display: inline-flex; align-items: center; justify-content: center; padding: 13px 14px; border-radius: 16px; font-weight: 900; transition: transform .2s ease, box-shadow .2s ease; }
.subject-btn:hover { transform: translateY(-3px); }
.subject-btn-temario { color: white; background: linear-gradient(135deg, var(--primary), var(--primary-dark)); box-shadow: 0 12px 24px rgba(34,135,240,.22); }
.subject-btn-ejercicios { color: #7a4a00; background: linear-gradient(135deg, var(--accent-soft), var(--accent)); box-shadow: 0 12px 24px rgba(255,179,0,.22); }
.detail-head { max-width: 960px; }
.detail-subject-image { width: min(220px, 100%); margin: 0 auto 10px; filter: drop-shadow(0 12px 20px rgba(15,71,155,.15)); }
.detail-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.detail-card { min-height: 190px; background: linear-gradient(180deg, rgba(255,255,255,.95), rgba(246,250,255,.85)); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow); padding: 24px; position: relative; overflow: hidden; }
.detail-card::after { content: ''; position: absolute; width: 120px; height: 120px; right: -44px; bottom: -44px; border-radius: 50%; background: radial-gradient(circle, rgba(34,135,240,.16), transparent 68%); }
.detail-card span { font-size: 2rem; }
.detail-card h3 { margin: 12px 0 10px; color: var(--primary-deep); }
.detail-card p { margin: 0; color: var(--muted); line-height: 1.65; }
.back-link { display: inline-flex; gap: 8px; align-items: center; color: var(--primary-dark); font-weight: 800; margin-top: 14px; }
.reveal, .scroll-pop { opacity: 0; transform: translateY(26px); transition: opacity .75s ease, transform .75s ease; }
.reveal.is-visible, .scroll-pop.is-visible { opacity: 1; transform: translateY(0); }
.tilt-on-scroll { transition: transform .35s ease; }
@keyframes drift { 0%,100% { transform: translateY(0) translateX(0); } 50% { transform: translateY(-16px) translateX(8px); } }
@keyframes floatUp { 0%,100% { transform: translateY(0) scale(1); opacity: .9; } 50% { transform: translateY(-18px) scale(1.08); opacity: .6; } }
@keyframes softFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@keyframes pulseGlow { 0%,100% { box-shadow: var(--shadow); } 50% { box-shadow: 0 22px 54px rgba(34,135,240,.28); } }
@keyframes bounceBadge { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.float-hero { animation: softFloat 4.4s ease-in-out infinite; }
.pulse { animation: pulseGlow 2.3s infinite; }
.bounce { animation: bounceBadge 2.5s ease-in-out infinite; }
@media (max-width: 1024px) {
  .hero-inner, .subjects-wrap { grid-template-columns: 1fr; }
  .level-grid { grid-template-columns: repeat(2, 1fr); }
  .detail-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-visual { order: -1; }
}
@media (max-width: 720px) {
  .container { width: min(100% - 24px, 1180px); }
  .hamburger { display: block; position: relative; z-index: 35; }
  .nav-links {
    position: fixed; top: 0; right: 0; width: min(82vw, 340px); height: 100vh; padding: 92px 24px 24px;
    flex-direction: column; align-items: stretch; gap: 12px; background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(238,245,255,.98));
    box-shadow: -20px 0 45px rgba(8,43,117,.18); transform: translateX(105%); transition: transform .28s ease; z-index: 32;
  }
  .nav-links.is-open { transform: translateX(0); }
  .nav-links a { padding: 14px 16px; border: 1px solid var(--line); border-radius: 16px; background: white; }
  .hero-panel { padding: 28px 20px; }
  .hero-panel .brand-mascot { width: 44px; height: 44px; }
  .hero-panel h1 { font-size: clamp(2.5rem, 11vw, 4.5rem); }
  .hero-inner { min-height: auto; padding-bottom: 70px; }
  .avatar-showcase { width: min(440px, 100%); }
  .level-grid, .subjects-wrap, .subject-actions, .detail-grid { grid-template-columns: 1fr; }
  .subject-top { grid-template-columns: 1fr; }
  .subject-thumb { margin: 0 auto; max-width: 180px; }
  .footer-inner { flex-direction: column; text-align: center; }
  .floating-icon, .course-icon { font-size: 1.4rem; }
  .brand { font-size: 1.15rem; }
  .brand-mascot { width: 30px; height: 30px; }
  .mini-marquee-track { animation-duration: 18s; }
  .course-center { padding: 18px 16px; max-width: 92%; }
}


.detail-link-card {
  text-decoration: none;
  color: inherit;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.detail-link-card:hover {
  transform: translateY(-7px);
  box-shadow: 0 24px 52px rgba(24,84,167,.22);
  border-color: #a8cfff;
}
.open-topic {
  display: inline-flex;
  margin-top: 16px;
  color: var(--primary-dark);
}
.slides-shell {
  max-width: 960px;
  margin: 0 auto;
  background: linear-gradient(180deg, rgba(255,255,255,.95), rgba(240,247,255,.88));
  border: 1px solid var(--line);
  border-radius: 34px;
  box-shadow: var(--shadow);
  padding: 28px;
}
.slides {
  position: relative;
  min-height: 360px;
  overflow: hidden;
}
.slide {
  display: none;
  min-height: 360px;
  padding: 34px;
  border-radius: 28px;
  background:
    radial-gradient(circle at 20% 20%, rgba(255,179,0,.18), transparent 22%),
    radial-gradient(circle at 80% 80%, rgba(34,135,240,.15), transparent 28%),
    white;
  border: 1px solid var(--line);
}
.slide.active {
  display: flex;
  flex-direction: column;
  justify-content: center;
  animation: slideFade .35s ease;
}
.slide-number {
  align-self: flex-start;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(34,135,240,.12);
  color: var(--primary-dark);
  font-weight: 900;
  margin-bottom: 18px;
}
.slide h2 {
  margin: 0 0 16px;
  color: var(--primary-deep);
  font-size: clamp(2rem, 4vw, 3.2rem);
}
.slide p {
  color: var(--muted);
  font-size: 1.18rem;
  line-height: 1.75;
  margin: 0;
}
.slide-controls {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  margin-top: 18px;
}
.slide-nav {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 900;
  cursor: pointer;
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  box-shadow: 0 12px 24px rgba(34,135,240,.22);
}
.slide-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
}
.slide-dot {
  width: 12px;
  height: 12px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  background: #b9d7ff;
}
.slide-dot.active {
  width: 28px;
  background: var(--accent);
}
.exercise-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
}
.exercise-card {
  background: linear-gradient(180deg, rgba(255,255,255,.95), rgba(246,250,255,.85));
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  padding: 24px;
}
.exercise-card h3 {
  margin: 0 0 10px;
  color: var(--primary-deep);
}
.exercise-card p {
  color: var(--muted);
  line-height: 1.7;
}
.solution-toggle {
  border: 0;
  border-radius: 999px;
  padding: 11px 16px;
  font-weight: 900;
  cursor: pointer;
  color: #7a4a00;
  background: linear-gradient(135deg, var(--accent-soft), var(--accent));
  box-shadow: 0 12px 24px rgba(255,179,0,.22);
}
.solution-box {
  display: none;
  margin-top: 14px;
  padding: 16px;
  border-radius: 16px;
  background: rgba(34,135,240,.08);
  color: var(--primary-deep);
  line-height: 1.65;
  border: 1px solid var(--line);
}
.solution-box.is-visible {
  display: block;
  animation: slideFade .25s ease;
}
@keyframes slideFade {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (max-width: 720px) {
  .slide-controls {
    grid-template-columns: 1fr;
  }
  .slide-nav {
    width: 100%;
  }
  .slides, .slide {
    min-height: 420px;
  }
  .slide {
    padding: 24px;
  }
  .exercise-grid {
    grid-template-columns: 1fr;
  }
}

/* Temario y presentaciones interactivas */
button.detail-card,
button.subject-btn {
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  border: 1px solid var(--line);
}
button.subject-btn {
  text-align: center;
}
.unavailable-trigger {
  cursor: pointer;
}
.presentation-shell {
  max-width: 940px;
  margin: 0 auto;
  background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(240,247,255,.9));
  border: 1px solid var(--line);
  border-radius: 30px;
  box-shadow: var(--shadow);
  padding: 18px;
  position: relative;
}
.presentation-stage {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  background: #eaf4ff;
  border: 1px solid var(--line);
  aspect-ratio: 16 / 9;
}
.presentation-slide {
  display: none;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: white;
}
.presentation-slide.active {
  display: block;
  animation: slideFade .25s ease;
}
.presentation-arrow,
.presentation-fullscreen {
  position: absolute;
  z-index: 6;
  border: 0;
  cursor: pointer;
  color: white;
  background: rgba(8,43,117,.78);
  box-shadow: 0 12px 24px rgba(8,43,117,.22);
  transition: transform .2s ease, background .2s ease, opacity .2s ease;
}
.presentation-arrow {
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  line-height: 1;
  padding-bottom: 6px;
}
.presentation-arrow:hover,
.presentation-fullscreen:hover {
  background: rgba(13,78,179,.9);
}
.presentation-arrow:hover { transform: translateY(-50%) scale(1.08); }
.presentation-prev { left: 34px; }
.presentation-next { right: 34px; }
.presentation-fullscreen {
  top: 30px;
  right: 30px;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  font-size: 1.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.presentation-controls {
  display: flex;
  justify-content: center;
  margin-top: 14px;
}
.presentation-counter {
  text-align: center;
  font-weight: 900;
  color: var(--primary-deep);
  background: white;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 16px;
}
.presentation-shell:fullscreen {
  max-width: none;
  width: 100vw;
  height: 100vh;
  border-radius: 0;
  padding: 28px;
  background: #082b75;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.presentation-shell:fullscreen .presentation-stage {
  width: 100%;
  max-height: calc(100vh - 110px);
}
.presentation-shell:fullscreen .presentation-counter {
  color: white;
  background: rgba(255,255,255,.14);
  border-color: rgba(255,255,255,.28);
}
@media (max-width: 720px) {
  .presentation-shell { padding: 10px; border-radius: 20px; }
  .presentation-stage { border-radius: 16px; }
  .presentation-arrow { width: 40px; height: 40px; font-size: 2.4rem; }
  .presentation-prev { left: 18px; }
  .presentation-next { right: 18px; }
  .presentation-fullscreen { top: 18px; right: 18px; width: 38px; height: 38px; }
}

/* Ajustes de imágenes de asignaturas */
.subject-thumb { max-height: 150px; object-fit: contain; }
@media (max-width: 720px) { .subject-thumb { max-height: 190px; } }

/* Cintas de cursos no disponibles */
.level-card.unavailable-course-card {
  cursor: pointer;
}
.level-card.unavailable-course-card h3,
.level-card.unavailable-course-card p,
.level-card.unavailable-course-card .level-link {
  transition: opacity .25s ease, filter .25s ease;
}
.level-card.unavailable-course-card:hover h3,
.level-card.unavailable-course-card:hover p,
.level-card.unavailable-course-card:hover .level-link {
  filter: blur(.4px);
}
.police-tape,
.nav-link-tape {
  --tape-yellow: #ffd21f;
  --tape-dark: #151515;
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-weight: 1000;
  color: #111;
  background:
    repeating-linear-gradient(135deg,
      var(--tape-yellow) 0 18px,
      var(--tape-dark) 18px 28px,
      var(--tape-yellow) 28px 46px);
  border: 3px solid #111;
  box-shadow: 0 14px 26px rgba(0,0,0,.18);
  z-index: 5;
  pointer-events: none;
}
.police-tape {
  left: -34px;
  right: -34px;
  top: 74px;
  min-height: 48px;
  transform: rotate(-12deg);
  border-radius: 7px;
  font-size: clamp(.82rem, 1.5vw, 1.05rem);
}
.police-tape::before,
.nav-link-tape::before {
  content: '';
  position: absolute;
  inset: 7px 0;
  background: rgba(255,255,255,.23);
  border-top: 1px solid rgba(255,255,255,.45);
  border-bottom: 1px solid rgba(0,0,0,.18);
}
.police-tape {
  overflow: hidden;
}
.police-tape.fall-and-return {
  animation: tapeFallReturn 1.65s ease-in-out both;
}
.nav-links a.nav-unavailable {
  position: relative;
  overflow: visible;
}
.nav-link-tape {
  left: 50%;
  top: 50%;
  width: 128px;
  min-height: 32px;
  border-width: 2px;
  border-radius: 5px;
  font-size: .63rem;
  transform: translate(-50%, -50%) rotate(-10deg) scale(.92);
  animation: navTapeCoverFall 2.35s ease-in-out forwards;
}
@keyframes tapeFallReturn {
  0% { transform: rotate(-12deg) translateY(0); opacity: 1; }
  25% { transform: rotate(-7deg) translateY(6px); }
  55% { transform: rotate(20deg) translateY(210px); opacity: .92; }
  70% { transform: rotate(20deg) translateY(210px); opacity: 0; }
  71% { transform: rotate(-12deg) translateY(-70px); opacity: 0; }
  100% { transform: rotate(-12deg) translateY(0); opacity: 1; }
}
@keyframes navTapeCoverFall {
  0% { transform: translate(-50%, -50%) rotate(-10deg) scale(.85); opacity: 0; }
  12% { transform: translate(-50%, -50%) rotate(-10deg) scale(1); opacity: 1; }
  62% { transform: translate(-50%, -50%) rotate(-10deg) scale(1); opacity: 1; }
  100% { transform: translate(-50%, 120px) rotate(24deg) scale(1); opacity: 0; }
}
@media (max-width: 720px) {
  .police-tape {
    top: 70px;
    left: -26px;
    right: -26px;
  }
  .nav-link-tape {
    width: 165px;
    min-height: 36px;
  }
}

/* Ejercicios bloqueados y autocorregibles */
.locked-topic {
  cursor: not-allowed;
  filter: grayscale(.12);
  position: relative;
  overflow: hidden;
}
.locked-topic::before {
  content: 'BLOQUEADO';
  position: absolute;
  top: 16px;
  right: -26px;
  transform: rotate(35deg);
  min-width: 130px;
  text-align: center;
  padding: 7px 12px;
  background: repeating-linear-gradient(45deg, #ffd765 0 12px, #12315e 12px 24px);
  color: white;
  font-weight: 900;
  letter-spacing: .08em;
  font-size: .72rem;
  box-shadow: 0 10px 20px rgba(8,43,117,.18);
  z-index: 3;
}
.btn-secondary {
  color: var(--primary-dark);
  background: white;
  border: 1px solid var(--line);
  box-shadow: 0 12px 24px rgba(24,84,167,.10);
}
.quiz-shell {
  max-width: 1080px;
}
.quiz-intro {
  margin: 0 auto 26px;
  padding: 26px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(246,250,255,.88));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  text-align: center;
}
.quiz-intro h2 {
  margin: 0 0 10px;
  color: var(--primary-deep);
  font-size: clamp(1.8rem, 3vw, 2.6rem);
}
.quiz-intro p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}
.auto-quiz {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
}
.quiz-card {
  padding: 24px;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(246,250,255,.88));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.quiz-card h3 {
  margin: 0 0 12px;
  color: var(--primary-deep);
}
.quiz-card p {
  margin: 0 0 16px;
  color: var(--muted);
  line-height: 1.6;
}
.quiz-card input {
  width: min(100%, 260px);
  max-width: 100%;
  border: 2px solid var(--line);
  border-radius: 16px;
  padding: 13px 14px;
  font-size: 1.05rem;
  color: var(--primary-deep);
  background: white;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.quiz-card input:focus {
  border-color: #80bdff;
  box-shadow: 0 0 0 4px rgba(34,135,240,.12);
}
.quiz-card input.is-correct {
  border-color: #2fb36d;
  background: #f1fff7;
}
.quiz-card input.is-wrong {
  border-color: #f05a5a;
  background: #fff5f5;
}
.quiz-feedback {
  min-height: 26px;
  margin: 12px 0 0 !important;
  font-weight: 900;
}
.quiz-feedback.correct { color: #1e8e55; }
.quiz-feedback.wrong { color: #c63838; }
.quiz-actions,
.quiz-result {
  grid-column: 1 / -1;
}
.quiz-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.quiz-result {
  display: none;
  padding: 22px;
  border-radius: var(--radius-md);
  background: rgba(34,135,240,.08);
  border: 1px solid var(--line);
  color: var(--primary-deep);
  font-size: 1.18rem;
  font-weight: 900;
  text-align: center;
}
.quiz-result.is-visible {
  display: block;
  animation: slideFade .25s ease;
}
@media (max-width: 720px) {
  .auto-quiz {
    grid-template-columns: 1fr;
  }
}

.topic-switch {
  display: flex;
  justify-content: center;
  margin: 28px auto 0;
  text-align: center;
}
.topic-switch-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 260px;
}
@media (max-width: 720px) {
  .topic-switch-btn {
    width: 100%;
    min-width: 0;
  }
}

/* Selector de ejercicios de números naturales */
.exercise-choice-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
}
.auto-quiz.single-column {
  grid-template-columns: 1fr;
}

/* Menú de herramientas */
.tools-menu {
  position: relative;
  margin-left: 12px;
  margin-right: auto;
  z-index: 40;
}
.tools-button {
  width: 58px;
  height: 58px;
  padding: 9px;
  border: 3px solid var(--primary);
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 10px 22px rgba(13,78,179,.16);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.tools-button:hover,
.tools-menu:focus-within .tools-button {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 14px 26px rgba(13,78,179,.22);
  border-color: var(--primary-dark);
}
.tools-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}
.tools-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 220px;
  padding: 10px;
  border-radius: 18px;
  background: rgba(255,255,255,.98);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity .2s ease, visibility .2s ease, transform .2s ease;
}
.tools-menu:hover .tools-dropdown,
.tools-menu:focus-within .tools-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.tools-dropdown a {
  display: block;
  padding: 12px 14px;
  border-radius: 14px;
  color: var(--primary-dark);
  font-weight: 900;
}
.tools-dropdown a:hover,
.tools-dropdown a:focus {
  background: rgba(34,135,240,.10);
}
@media (max-width: 720px) {
  .tools-menu { margin-left: 8px; }
  .tools-button {
    width: 52px;
    height: 52px;
    padding: 8px;
  }
  .tools-img {
    width: 32px;
    height: 32px;
  }
  .tools-dropdown {
    left: auto;
    right: 0;
    min-width: 210px;
  }
}

/* Calculadoras de herramientas */
.tool-calculator-shell {
  max-width: 760px;
  margin: 0 auto;
}
.tool-calculator-card {
  padding: 30px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(246,250,255,.88));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.tool-calculator-form {
  display: grid;
  gap: 18px;
}
.tool-calculator-field {
  display: grid;
  gap: 8px;
}
.tool-calculator-field label {
  font-weight: 900;
  color: var(--primary-deep);
}
.tool-calculator-field input {
  width: 100%;
  border: 2px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  font-size: 1.08rem;
  color: var(--primary-deep);
  background: #ffffff;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.tool-calculator-field input:focus {
  border-color: #80bdff;
  box-shadow: 0 0 0 4px rgba(34,135,240,.12);
}
.tool-calculator-result {
  display: none;
  margin-top: 20px;
  padding: 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  font-weight: 900;
  text-align: center;
  font-size: 1.18rem;
}
.tool-calculator-result.is-visible {
  display: block;
  animation: slideFade .25s ease;
}
.tool-calculator-result.success {
  color: #1e8e55;
  background: #f1fff7;
  border-color: rgba(47,179,109,.35);
}
.tool-calculator-result.error {
  color: #c63838;
  background: #fff5f5;
  border-color: rgba(240,90,90,.35);
}

.math-topics-wrap .math-topic-card .subject-top {
  align-items: flex-start;
}
.math-topic-card.locked-topic {
  border-style: dashed;
  opacity: .88;
}
.topic-icon {
  display: inline-flex;
  width: 46px;
  height: 46px;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: #eef6ff;
  border: 1px solid var(--line);
  font-size: 1.45rem;
  margin-bottom: 8px;
}

/* Ajuste selector de ejercicios: tres columnas en escritorio */
.exercise-choice-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
}
.exercise-choice-list .detail-link-card {
  height: 100%;
}
@media (max-width: 900px) {
  .exercise-choice-list {
    grid-template-columns: 1fr;
  }
}


/* Ayuda en la parte inferior de la página principal */
.help-section {
  padding: 10px 0 28px;
}
.help-details {
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
}
.help-details summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: 900;
  color: var(--primary-deep);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 22px;
  box-shadow: var(--shadow-soft);
  list-style: none;
}
.help-details summary::-webkit-details-marker {
  display: none;
}
.help-details p {
  margin: 14px auto 0;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  background: #ffffff;
  border: 1px solid var(--line);
  color: var(--text);
  box-shadow: var(--shadow-soft);
}
.help-details a {
  color: var(--primary);
  font-weight: 900;
  text-decoration: none;
}
.help-details a:hover {
  text-decoration: underline;
}


/* Ayuda bajo el logotipo del pie de la página principal */
.footer-brand-help {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}
.footer-brand-help > p {
  margin: 0;
}
.footer-help-details {
  max-width: 620px;
}
.footer-help-details summary {
  display: inline;
  cursor: pointer;
  font-weight: 800;
  color: var(--primary-dark);
  list-style: none;
}
.footer-help-details summary::-webkit-details-marker {
  display: none;
}
.footer-help-details p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.5;
}
.footer-help-details a {
  color: var(--primary-dark);
  font-weight: 900;
  text-decoration: none;
}
.footer-help-details a:hover {
  text-decoration: underline;
}
@media (max-width: 720px) {
  .footer-brand-help {
    align-items: center;
    text-align: center;
  }
}
.footer-legal-links {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  width: 100%;
  padding: 8px 16px 16px;
  font-size: 0.9rem;
}

.footer-legal-links a {
  color: inherit;
  text-decoration: underline;
}
