/* ===== Mapa (sección #mapa) ===== */
.map-section {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4rem clamp(1rem, 5vw, 4rem);
  gap: 2.5rem;
}

@media (max-width: 480px) {
  .map-section {
    padding: 2.25rem clamp(0.75rem, 4vw, 2rem);
    gap: 1.5rem;
  }
}
.map-section .section-desc,
.articles-text-box {
  width: min(100%, 1100px);
  font-size: clamp(0.95rem, 2vw, 1.2rem);
  line-height: 1.8;
  font-family: "Ink Free", "Nunito", sans-serif;
  color: #f4f8ff;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-lg);
  padding: clamp(1rem, 2vw, 1.5rem) clamp(1rem, 3vw, 2rem);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.map-section .section-desc {
  text-align: center;
}

.articles-text-box {
  min-height: 120px;
  margin: 0 auto 2rem;
}

.map-section .section-title {
  font-family: "Ink Free", "Baloo 2", cursive;
}
.map-container.map-container--leaflet {
  position: relative;
  width: min(100%, 1100px);
  margin: 0 auto;
}

.map-leaflet-root {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  min-height: 300px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid rgba(79, 195, 247, 0.22);
  box-shadow:
    0 8px 40px rgba(0, 0, 0, 0.45),
    0 0 40px rgba(79, 195, 247, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  background: linear-gradient(
    165deg,
    rgba(13, 27, 62, 0.95),
    rgba(6, 13, 31, 0.98)
  );
}

.map-leaflet-root .leaflet-container {
  width: 100%;
  height: 100%;
  font-family: "Nunito", sans-serif;
  background: var(--bg-mid);
  outline: none;
  border-radius: inherit;
}

.map-leaflet-root .leaflet-control-zoom {
  border: none !important;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45) !important;
  border-radius: 14px !important;
  overflow: hidden;
}

.map-leaflet-root .leaflet-control-zoom a {
  width: 34px !important;
  height: 34px !important;
  line-height: 34px !important;
  font-size: 18px !important;
  font-weight: 700 !important;
  color: var(--text-main) !important;
  background: rgba(15, 30, 61, 0.92) !important;
  border-bottom: 1px solid rgba(79, 195, 247, 0.15) !important;
}

.map-leaflet-root .leaflet-control-zoom a:last-child {
  border-bottom: none !important;
}

.map-leaflet-root .leaflet-control-zoom a:hover {
  background: rgba(79, 195, 247, 0.22) !important;
  color: #fff !important;
}

.map-leaflet-root .leaflet-control-attribution {
  background: rgba(6, 13, 31, 0.78) !important;
  color: var(--text-muted) !important;
  border-radius: 10px 0 0 0 !important;
  padding: 4px 10px !important;
  font-size: 10px !important;
  max-width: calc(100% - 12px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.map-leaflet-root .leaflet-control-attribution a {
  color: var(--accent1) !important;
}

.map-marker-pin.leaflet-marker-icon {
  background: transparent !important;
  border: none !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.map-marker-dot {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #ff8a80, #ef5350 55%, #c62828);
  border: 2px solid rgba(255, 255, 255, 0.95);
  box-shadow:
    0 0 0 1px rgba(79, 195, 247, 0.25),
    0 2px 10px rgba(0, 0, 0, 0.45);
  transition:
    box-shadow 0.35s ease,
    transform 0.28s ease,
    filter 0.28s ease;
}

.map-marker-pin.map-marker-pin--lit .map-marker-dot {
  transform: scale(1.14);
  filter: brightness(1.08);
  box-shadow:
    0 0 18px 6px rgba(79, 195, 247, 0.45),
    0 0 28px rgba(239, 83, 80, 0.45),
    0 2px 12px rgba(0, 0, 0, 0.5);
}

@media (prefers-reduced-motion: reduce) {
  .map-marker-dot {
    transition: none;
  }
}

.map-marker-tooltip.leaflet-tooltip {
  background: rgba(15, 30, 61, 0.95);
  color: var(--text-main);
  border: 1px solid rgba(79, 195, 247, 0.35);
  border-radius: 10px;
  padding: 6px 12px;
  font-weight: 700;
  font-size: 0.82rem;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}

.map-marker-tooltip.leaflet-tooltip-top:before {
  border-top-color: rgba(15, 30, 61, 0.95);
}

.map-popup .leaflet-popup-content-wrapper {
  background: linear-gradient(165deg, #132447, #0a162f);
  color: var(--text-main);
  border-radius: var(--radius-lg);
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(79, 195, 247, 0.28);
  box-shadow:
    0 22px 50px rgba(0, 0, 0, 0.55),
    0 0 30px rgba(79, 195, 247, 0.12);
}

.map-popup .leaflet-popup-content {
  margin: 0;
  min-width: min(260px, 72vw);
}

.map-popup .leaflet-popup-tip {
  background: #132447;
  border: 1px solid rgba(79, 195, 247, 0.25);
  box-shadow: none;
}

.map-popup-inner {
  padding: 16px 18px 14px;
}

.map-popup-title {
  display: block;
  font-family: "Baloo 2", cursive;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--accent1);
  margin-bottom: 10px;
  line-height: 1.25;
}

.map-popup-desc {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--text-muted);
}

.map-popup-photo-slots {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.map-popup-photo-slot {
  border: 1px dashed rgba(79, 195, 247, 0.38);
  border-radius: 10px;
  padding: 6px 6px 5px;
  background: rgba(0, 0, 0, 0.14);
}

.map-popup-photo-frame {
  min-height: 48px;
  max-height: 104px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  overflow: hidden;
  background: rgba(6, 13, 31, 0.45);
  margin-bottom: 4px;
}

.map-popup-photo-img {
  display: block;
  max-width: 100%;
  width: auto;
  max-height: clamp(72px, 14vh, 96px);
  height: auto;
  object-fit: contain;
  margin: 0 auto;
  vertical-align: middle;
  border-radius: 4px;
}

.map-popup-photo-hint {
  margin: 0;
  padding: 6px 4px;
  font-size: 0.68rem;
  line-height: 1.35;
  color: var(--text-muted);
  text-align: center;
}

.map-popup-photo-path {
  display: block;
  font-size: 0.6rem;
  line-height: 1.4;
  word-break: break-all;
  color: rgba(144, 164, 183, 0.92);
  font-family: ui-monospace, monospace;
}

@media (max-width: 320px) {
  .map-popup-photo-slots {
    grid-template-columns: 1fr;
  }
}

.map-popup a.leaflet-popup-close-button {
  width: 28px !important;
  height: 28px !important;
  top: 10px !important;
  right: 10px !important;
  padding: 0 !important;
  font-size: 20px !important;
  line-height: 26px !important;
  color: rgba(255, 255, 255, 0.65) !important;
  border-radius: 50%;
  transition:
    background 0.2s,
    color 0.2s;
}

.map-popup a.leaflet-popup-close-button:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff !important;
}

@media (max-width: 768px) {
  .map-popup .leaflet-popup-content {
    min-width: 250px;
    max-width: 85vw !important;
  }

  .map-popup-inner {
    padding: 10px 12px 9px;
    max-height: 55vh;
  }

  .map-popup-title {
    font-size: 0.95rem;
    margin-bottom: 5px;
  }

  .map-popup-desc {
    font-size: 0.82rem;
    line-height: 1.5;
  }

  .map-popup-photo-slots {
    margin-top: 8px;
    gap: 6px;
  }

  .map-popup-photo-frame {
    max-height: 100px;
  }

  .map-popup-photo-img {
    max-height: clamp(70px, 14vh, 95px);
  }

  .map-popup a.leaflet-popup-close-button {
    width: 24px !important;
    height: 24px !important;
    top: 6px !important;
    right: 6px !important;
    font-size: 16px !important;
    line-height: 22px !important;
  }
}

@media (max-width: 480px) {
  .map-leaflet-root {
    height: auto;
    aspect-ratio: 1 / 1;
    min-height: 0;
    border-radius: var(--radius-lg);
  }

  .map-popup .leaflet-popup-content {
    min-width: 230px;
    max-width: 90vw !important;
  }

  .map-popup-inner {
    padding: 9px 11px 8px;
    max-height: 50vh;
  }

  .map-popup-title {
    font-size: 0.9rem;
    margin-bottom: 4px;
  }

  .map-popup-desc {
    font-size: 0.8rem;
    line-height: 1.45;
  }
}

/* ===== Galería / artículos (sección #articulos) ===== */
.articles-section {
  position: relative;
  z-index: 2;
  padding: 3rem clamp(1rem, 5vw, 4rem);
}

.articles-section .section-title {
  font-family: "Ink Free", "Baloo 2", cursive;
}

.articles-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(12px, 2vw, 22px);
  max-width: 1100px;
  margin: 0 auto;
}

@media (max-width: 1024px) {
  .articles-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 540px) {
  .articles-grid {
    grid-template-columns: 1fr;
  }
}
.article-card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition:
    transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.3s;
  backdrop-filter: blur(8px);
}
.article-card:hover {
  transform: translateY(-8px);
  box-shadow:
    0 20px 40px rgba(0, 0, 0, 0.5),
    0 0 20px rgba(79, 195, 247, 0.1);
}
.article-card:focus-visible {
  outline: 2px solid rgba(79, 195, 247, 0.75);
  outline-offset: 3px;
}
.article-thumb {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  display: block;
}
.article-thumb-placeholder {
  width: 100%;
  aspect-ratio: 3/4;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  background: linear-gradient(135deg, #1a2a4a, #0d1b3e);
}
.article-label {
  padding: 10px 12px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent1);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.article-modal-overlay {
  z-index: 210;
}

.modal.article-modal {
  max-width: min(800px, 94vw);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-height: 92vh;
  background:
    radial-gradient(
      120% 110% at 50% 0%,
      rgba(255, 248, 226, 0.95),
      rgba(242, 229, 196, 0.95) 58%,
      rgba(222, 202, 162, 0.98)
    ),
    linear-gradient(180deg, #f8efd5, #e8d6ad);
  border: 2px solid rgba(143, 106, 58, 0.6);
  box-shadow:
    0 30px 90px rgba(0, 0, 0, 0.7),
    0 0 0 1px rgba(255, 255, 255, 0.3) inset,
    inset 0 2px 0 rgba(255, 255, 255, 0.6),
    inset 0 -2px 0 rgba(107, 76, 39, 0.25);
  color: #332714;
  position: relative;
  border-radius: 8px 24px 24px 8px;
  padding: 0 14px 0 14px;
}

.modal.article-modal .book-spine {
  position: absolute;
  top: 0;
  left: 0;
  width: 40px;
  height: 100%;
  background: linear-gradient(90deg, rgba(107, 76, 39, 0.15), transparent);
  pointer-events: none;
  z-index: 1;
}

.modal.article-modal::before,
.modal.article-modal::after {
  content: "";
  position: absolute;
  top: 14px;
  bottom: 14px;
  width: 14px;
  pointer-events: none;
  border-radius: 8px;
}

.modal.article-modal::before {
  left: 0;
  background: repeating-linear-gradient(
    180deg,
    rgba(138, 103, 58, 0.24) 0 2px,
    rgba(255, 244, 215, 0.84) 2px 5px
  );
  box-shadow:
    inset -2px 0 4px rgba(94, 68, 35, 0.35),
    1px 0 0 rgba(255, 255, 255, 0.45);
}

.modal.article-modal::after {
  right: 0;
  background: repeating-linear-gradient(
    180deg,
    rgba(138, 103, 58, 0.24) 0 2px,
    rgba(255, 244, 215, 0.84) 2px 5px
  );
  box-shadow:
    inset 2px 0 4px rgba(94, 68, 35, 0.35),
    -1px 0 0 rgba(255, 255, 255, 0.45);
}

.modal.article-modal .article-modal-title {
  margin-bottom: 0.5rem;
  margin-top: 1rem;
  flex-shrink: 0;
  color: #5f3e17;
  padding: 0 1rem;
}

.article-modal-tag {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #7c5924;
  flex-shrink: 0;
  padding: 0 1rem;
}

.article-modal-subtitle {
  margin: 0 0 1rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #4f3a1a;
  line-height: 1.45;
  flex-shrink: 0;
  padding: 0 1rem;
}

.article-modal-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  margin: 0;
  padding: 1rem 1.5rem 1.5rem;
  font-size: 0.98rem;
  line-height: 1.85;
  color: #3d2f17;
  white-space: pre-line;
  column-count: 2;
  column-gap: 36px;
  column-rule: 1px solid rgba(130, 98, 54, 0.18);
  text-align: justify;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.08) 49.5%, rgba(0, 0, 0, 0) 50%),
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.28),
      rgba(255, 255, 255, 0.08)
    );
  border-radius: 8px;
  border: 1px solid rgba(126, 95, 58, 0.25);
  box-shadow:
    inset 0 0 30px rgba(115, 85, 45, 0.12),
    inset 0 0 3px rgba(255, 255, 255, 0.5);
}

.article-modal-body::before {
  content: "";
  position: sticky;
  top: 0;
  display: block;
  height: 8px;
  margin: -1rem -1.5rem 1rem;
  background: repeating-linear-gradient(
    90deg,
    rgba(112, 81, 42, 0.1) 0 4px,
    rgba(255, 248, 227, 0.8) 4px 8px
  );
  border-bottom: 1px solid rgba(125, 93, 53, 0.2);
  z-index: 1;
}

.article-modal-body a {
  color: #1f4a89;
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-all;
}

@media (max-width: 760px) {
  .article-modal-body {
    column-count: 1;
    column-rule: none;
    padding: 1rem 1.2rem 1.5rem;
    font-size: 0.9rem;
    line-height: 1.75;
  }

  .article-modal-body::before {
    margin: -1rem -1.2rem 1rem;
  }

  .modal.article-modal {
    max-width: 95vw;
    border-radius: 16px;
    padding: 0 10px 0 10px;
    max-height: 90vh;
  }

  .modal.article-modal .book-spine {
    display: none;
  }

  .modal.article-modal::before,
  .modal.article-modal::after {
    top: 10px;
    bottom: 10px;
    width: 10px;
  }

  .article-modal-title {
    margin-top: 0.8rem;
    padding: 0 0.8rem;
    font-size: 1.1rem;
  }

  .article-modal-tag {
    padding: 0 0.8rem;
    font-size: 0.68rem;
  }

  .article-modal-subtitle {
    padding: 0 0.8rem;
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  .modal.article-modal {
    padding: 0 8px 0 8px;
  }

  .article-modal-body {
    padding: 0.8rem 1rem 1.2rem;
    font-size: 0.85rem;
    line-height: 1.7;
  }

  .article-modal-body::before {
    margin: -0.8rem -1rem 0.8rem;
  }
}

.article-modal-body::-webkit-scrollbar {
  width: 10px;
}
.article-modal-body::-webkit-scrollbar-thumb {
  background: rgba(126, 95, 58, 0.4);
  border-radius: 10px;
  border: 2px solid rgba(255, 255, 255, 0.3);
}
.article-modal-body::-webkit-scrollbar-track {
  background: rgba(126, 95, 58, 0.08);
  border-radius: 10px;
}

/* ===== Videos page ===== */
.videos-hero,
.games-hero,
.gallery-hero,
.glosario-hero {
  min-height: auto;
  padding-top: 2.5rem;
  padding-bottom: 1.5rem;
}

.videos-hero .nav-icons-wrapper,
.games-hero .nav-icons-wrapper,
.gallery-hero .nav-icons-wrapper,
.glosario-hero .nav-icons-wrapper {
  margin-top: 0;
  margin-bottom: 1.2rem;
}

.videos-hero-desc,
.glosario-hero-desc {
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

.videos-hero-desc {
  line-height: 1.8;
}

.videos-hero > .section-title {
  font-family: "Ink Free", "Nunito", sans-serif;
}

.glosario-hero > .section-title {
  font-family: "Ink Free", "Nunito", sans-serif;
}

.videos-hero .videos-hero-desc {
  font-family: "Ink Free", "Nunito", sans-serif;
  color: #ffffff;
}

.glosario-hero .glosario-hero-desc {
  font-family: "Ink Free", "Nunito", sans-serif;
  color: #ffffff;
}

.home-hero-desc {
  width: min(100%, 1400px);
  max-width: 1400px;
  text-align: justify;
  font-family: "Ink Free", "Nunito", sans-serif;
  font-size: clamp(1.05rem, 2.15vw, 1.32rem);
  color: #ffffff;
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
}

.home-hero-title {
  font-family: "Ink Free", "Baloo 2", cursive;
}

.videos-section {
  position: relative;
  z-index: 2;
  width: min(1240px, 95%);
  margin: 0 auto;
  padding: 1rem 0 2.5rem;
}

.videos-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(14px, 2vw, 22px);
}

@media (max-width: 1200px) {
  .videos-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .videos-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 420px) {
  .videos-grid {
    grid-template-columns: 1fr;
  }
}

.video-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.28);
  transform-origin: center center;
  transition:
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.25s ease,
    opacity 0.35s ease,
    filter 0.35s ease;
  will-change: transform, opacity;
}

.video-card:hover {
  transform: translateY(-6px);
  border-color: rgba(79, 195, 247, 0.45);
  box-shadow:
    0 20px 40px rgba(0, 0, 0, 0.45),
    0 0 20px rgba(79, 195, 247, 0.12);
}

.video-card-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
}

.video-card-frame iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.video-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition:
    transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    filter 0.3s ease;
}

.video-preview:hover .video-thumb {
  transform: scale(1.06);
  filter: brightness(1.05);
}

.video-play-btn {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(1);
  transition:
    transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
    background 0.25s ease,
    box-shadow 0.3s ease;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.video-preview:hover .video-play-btn {
  transform: translate(-50%, -50%) scale(1.12);
  background: rgba(220, 38, 38, 0.92);
  box-shadow: 0 10px 26px rgba(220, 38, 38, 0.45);
}

.video-unavailable {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #111;
  color: #d3dbe4;
  font-weight: 700;
  padding: 0 12px;
  text-align: center;
}

.video-card-body {
  padding: 0.45rem 0.7rem 0.55rem;
  transition: padding 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.video-card-title {
  font-size: 0.96rem;
  font-weight: 800;
  line-height: 1.3;
  color: var(--text-main);
  transition: font-size 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.video-card-link {
  display: inline-block;
  margin-top: 0.3rem;
  font-size: 0.8rem;
  color: var(--accent1);
  text-decoration: none;
  font-weight: 700;
}

.video-card-link:hover {
  color: #8fd9ff;
}

/* ===== Modal de video (overlay premium) ===== */
body.video-modal-open {
  overflow: hidden;
}

.video-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 3vw, 32px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.video-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.video-modal[aria-hidden="true"] {
  visibility: hidden;
}

.video-modal.is-open[aria-hidden="false"] {
  visibility: visible;
}

.video-modal-backdrop {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at center,
    rgba(8, 12, 20, 0.78) 0%,
    rgba(0, 0, 0, 0.92) 100%
  );
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  cursor: pointer;
}

.video-modal-container {
  position: relative;
  width: min(1180px, 100%);
  max-height: calc(100vh - 32px);
  background: #0b0d12;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  overflow: hidden;
  box-shadow:
    0 40px 90px rgba(0, 0, 0, 0.7),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 0 60px rgba(79, 195, 247, 0.12);
  transform: scale(0.92) translateY(12px);
  opacity: 0;
  transition:
    transform 0.42s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.32s ease;
  display: flex;
  flex-direction: column;
}

.video-modal.is-open .video-modal-container {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.video-modal-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  flex: 0 0 auto;
}

.video-modal-frame iframe,
.video-modal-frame video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  object-fit: cover;
}

.video-modal-toolbar {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 8px;
  z-index: 6;
}

.video-modal-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
  transition:
    background 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease;
}

.video-modal-btn:hover {
  transform: scale(1.08);
}

.video-modal-btn:focus-visible {
  outline: 2px solid #4fc3f7;
  outline-offset: 2px;
}

.video-modal-close:hover {
  background: rgba(220, 38, 38, 0.92);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 8px 22px rgba(220, 38, 38, 0.45);
}

.video-modal-fs:hover {
  background: rgba(79, 195, 247, 0.92);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 8px 22px rgba(79, 195, 247, 0.45);
}

.video-modal-title {
  padding: 14px 18px 16px;
  color: #f4f8ff;
  font-family: "Nunito", "Baloo 2", sans-serif;
  font-weight: 800;
  font-size: clamp(0.95rem, 1.6vw, 1.1rem);
  line-height: 1.35;
  background: linear-gradient(180deg, #0b0d12 0%, #07080b 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  overflow-wrap: anywhere;
}

.video-modal-title:empty {
  display: none;
}

/* Cuando el modal entra en pantalla completa, el contenedor ocupa toda la pantalla */
.video-modal-container:fullscreen,
.video-modal-container:-webkit-full-screen {
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  max-height: 100vh;
  border-radius: 0;
  border: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.video-modal-container:fullscreen .video-modal-frame,
.video-modal-container:-webkit-full-screen .video-modal-frame {
  flex: 1 1 auto;
  height: 100%;
}

.video-modal-container:fullscreen .video-modal-title,
.video-modal-container:-webkit-full-screen .video-modal-title {
  display: none;
}

@media (max-width: 720px) {
  .video-modal {
    padding: 8px;
  }

  .video-modal-container {
    border-radius: 14px;
  }

  .video-modal-btn {
    width: 36px;
    height: 36px;
  }

  .video-modal-toolbar {
    top: 8px;
    right: 8px;
  }

  .video-modal-title {
    padding: 10px 14px 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .video-card,
  .video-thumb,
  .video-play-btn,
  .video-card-body,
  .video-card-title,
  .video-modal,
  .video-modal-container,
  .video-modal-btn {
    transition: none;
  }
}

/* ===== Juegos page ===== */
.games-section {
  position: relative;
  z-index: 2;
  width: min(1200px, 95%);
  margin: 0 auto;
  padding: 1rem 0 2.8rem;
}

.games-section .section-title,
.gallery-section .section-title {
  font-family: "Ink Free", "Nunito", sans-serif;
}

.games-section .hero-sub,
.gallery-section .hero-sub {
  font-family: "Ink Free", "Nunito", sans-serif;
  color: #ffffff;
}

.games-section .games-grid,
.gallery-section .film-strip-outer {
  margin-top: clamp(1.75rem, 4.5vw, 2.75rem);
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: clamp(16px, 2.5vw, 28px);
}

.game-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(236, 64, 122, 0.18);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition:
    transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.3s;
  display: flex;
  flex-direction: column;
}

.game-card:hover {
  transform: translateY(-6px);
  box-shadow:
    0 20px 44px rgba(0, 0, 0, 0.5),
    0 0 24px rgba(236, 64, 122, 0.12);
}

.game-embed {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #080c18;
  position: relative;
  overflow: hidden;
}

.game-embed iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.embed-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(135deg, #0d1228, #1a0d18);
  cursor: pointer;
  transition: background 0.3s;
  position: relative;
}

.embed-placeholder:hover {
  background: linear-gradient(135deg, #141830, #220d20);
}

.embed-ph-icon {
  font-size: 3rem;
  opacity: 0.28;
}

.embed-ph-label {
  font-size: 0.72rem;
  font-weight: 800;
  color: rgba(236, 64, 122, 0.5);
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.embed-ph-hint {
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.18);
  font-weight: 600;
}

.slot-badge {
  position: absolute;
  top: 10px;
  left: 12px;
  font-size: 0.65rem;
  font-weight: 800;
  color: rgba(236, 64, 122, 0.5);
  background: rgba(0, 0, 0, 0.5);
  padding: 2px 8px;
  border-radius: 20px;
  letter-spacing: 0.8px;
  z-index: 2;
}

.embed-placeholder::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px dashed rgba(236, 64, 122, 0.2);
  transition: border-color 0.3s;
}

.embed-placeholder:hover::after {
  border-color: rgba(236, 64, 122, 0.5);
}

.game-info {
  padding: 14px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.game-title {
  font-family: "Baloo 2", cursive;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-main);
}

.game-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.game-tag {
  display: inline-block;
  margin-top: 4px;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 20px;
  background: rgba(236, 64, 122, 0.12);
  color: #ec407a;
  border: 1px dashed rgba(236, 64, 122, 0.3);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  width: fit-content;
}

@media (max-width: 600px) {
  .games-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== Modal de juego ===== */
.game-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(12px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(8px, 2vw, 16px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  overflow: hidden;
}

.game-modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.game-modal {
  position: relative;
  width: min(800px, 100%);
  max-height: 100vh;
  height: 100vh;
  background: linear-gradient(160deg, #0f1e3d, #060d1f);
  border: 1px solid rgba(79, 195, 247, 0.25);
  border-radius: 0;
  overflow: hidden;
  box-shadow:
    0 40px 90px rgba(0, 0, 0, 0.7),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 0 60px rgba(79, 195, 247, 0.12);
  transform: scale(0.92) translateY(12px);
  opacity: 0;
  transition:
    transform 0.42s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.32s ease;
  display: flex;
  flex-direction: column;
}

.game-modal-overlay.active .game-modal {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.game-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
  transition:
    background 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease;
  z-index: 10;
}

.game-modal-close:hover {
  background: rgba(220, 38, 38, 0.92);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 8px 22px rgba(220, 38, 38, 0.45);
  transform: scale(1.08);
}

.game-modal-header {
  padding: 12px 20px 10px;
  background: linear-gradient(180deg, #0b0d12 0%, #07080b 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.game-modal-title {
  font-family: "Baloo 2", cursive;
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  font-weight: 800;
  color: var(--text-main);
  margin: 0;
  padding-right: 50px;
}

.game-modal-content {
  flex: 1;
  min-height: 0;
  background: #000;
  overflow: hidden;
  position: relative;
}

.game-modal-content iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

@media (min-width: 769px) {
  .game-modal-overlay {
    padding: clamp(12px, 3vw, 32px);
  }
  .game-modal {
    width: min(1000px, 95vw);
    max-width: 95vw;
    height: 90vh;
    max-height: 90vh;
    border-radius: var(--radius-xl);
  }
  .game-modal-content {
    height: 100%;
    display: flex;
    flex-direction: column;
  }
  .game-modal-content iframe {
    flex: 1;
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
  }
}

@media (max-width: 720px) {
  .game-modal-overlay {
    padding: 0;
  }
  .game-modal {
    width: 100vw !important;
    height: 100vh !important;
    max-height: 100vh !important;
    border-radius: 0 !important;
    border: none !important;
  }
  .game-modal-overlay.active .game-modal {
    transform: none !important;
  }
  .game-modal-header {
    display: none !important;
  }
  .game-modal-content {
    height: 100vh !important;
    width: 100vw !important;
  }
  .game-modal-content iframe {
    width: 100% !important;
    height: 100% !important;
  }
  .game-modal-close {
    position: fixed !important;
    top: 15px !important;
    right: 15px !important;
    width: auto !important;
    height: auto !important;
    padding: 8px 16px !important;
    font-size: 1rem !important;
    border-radius: 20px !important;
    background: rgba(220, 38, 38, 0.95) !important;
    border: 2px solid white !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5) !important;
    font-family: "Nunito", sans-serif !important;
    font-weight: bold !important;
    z-index: 99999 !important;
  }
  .game-modal-close::after {
    content: " Cerrar";
    margin-left: 5px;
  }
}

/* ===== Gallery page ===== */
.gallery-section {
  position: relative;
  z-index: 2;
  width: min(1180px, 96%);
  margin: 0 auto;
  padding: 1rem 0 2.8rem;
}

.film-strip-outer {
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.film-strip-track {
  display: flex;
  width: max-content;
  animation: galleryStripScroll 500s linear infinite;
}

.film-strip-track:hover {
  animation-play-state: paused;
}

@keyframes galleryStripScroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

.film-frame {
  width: clamp(288px, 52vw, 400px);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  background: #0f1220;
  border-right: 3px solid #191e33;
  cursor: zoom-in;
}

.perfs {
  display: flex;
  justify-content: space-around;
  align-items: center;
  height: 16px;
  background: #0a0c16;
  padding: 0 4px;
}

.perf {
  width: 10px;
  height: 8px;
  border-radius: 2px;
  border: 1px solid #232842;
  background: #05060a;
}

.frame-photo {
  aspect-ratio: 1 / 1;
  position: relative;
  overflow: hidden;
  background: #0f1220;
}

.frame-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.3s ease;
}

.film-frame:hover .frame-photo img {
  transform: scale(1.06);
}

.ph-wrap {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: linear-gradient(135deg, #10162d, #1a1231);
}

.ph-icon {
  font-size: 1.7rem;
  opacity: 0.35;
}
.ph-label {
  font-size: 0.65rem;
  font-weight: 800;
  color: rgba(206, 147, 216, 0.75);
  letter-spacing: 0.7px;
}

.frame-num {
  position: absolute;
  right: 6px;
  bottom: 4px;
  font-size: 0.56rem;
  color: rgba(255, 255, 255, 0.35);
  font-family: monospace;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 500;
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.9);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.lightbox.active {
  opacity: 1;
  pointer-events: all;
}

.lb-close,
.lb-nav {
  position: absolute;
  border: none;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.14);
}

.lb-close {
  top: 1rem;
  right: 1rem;
  width: 40px;
  height: 40px;
  font-size: 1.2rem;
}

.lb-nav {
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  font-size: 1.9rem;
}

.lb-prev {
  left: 1rem;
}
.lb-next {
  right: 1rem;
}

.lb-content {
  width: min(880px, 100%);
}

.lb-film {
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.lb-perfs {
  height: 18px;
  background-image: repeating-linear-gradient(
    90deg,
    #06070d 0 10px,
    #161a2b 10px 18px
  );
}

.lb-photo {
  width: 100%;
  aspect-ratio: 16 / 10;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #07090f;
}

.lb-photo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.lb-caption {
  text-align: center;
  margin-top: 0.8rem;
}

.lb-caption p {
  color: var(--text-muted);
  margin-top: 0.25rem;
}

@media (max-width: 760px) {
  .lb-nav {
    display: none;
  }
}

/* ===== Glosario (página glosario.html) ===== */
.glosario-hero-desc {
  font-size: clamp(0.92rem, 1.5vw, 1.06rem);
  color: #ffffff;
  line-height: 1.85;
}

.glossary-section {
  position: relative;
  z-index: 2;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 clamp(1rem, 5vw, 3rem) 5rem;
  display: block;
}

.word-list-panel {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-xl);
  padding: 1.5rem clamp(1rem, 3vw, 2rem);
  backdrop-filter: blur(10px);
}

.word-list-title {
  font-family: "Baloo 2", cursive;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--accent5);
  margin-bottom: 1.2rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.word-search {
  display: flex;
  align-items: center;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50px;
  overflow: hidden;
  margin-bottom: 1.2rem;
  transition: box-shadow 0.3s;
}

.word-search:focus-within {
  box-shadow: 0 0 0 3px rgba(206, 147, 216, 0.2);
}

.word-search input {
  cursor: text;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  padding: 8px 14px;
  font-family: "Nunito", sans-serif;
  font-size: 0.88rem;
  flex: 1;
}

.word-search input::placeholder {
  color: var(--text-muted);
}

.word-search span {
  padding: 0 12px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.word-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

@media (max-width: 1200px) {
  .word-list {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 900px) {
  .word-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

.definition-panel {
  display: none;
}

.word-item {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.02);
  position: relative;
  overflow: hidden;
}

.word-item-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
}

.word-item:hover {
  background: rgba(206, 147, 216, 0.08);
  border-color: rgba(206, 147, 216, 0.25);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.word-item.active {
  background: rgba(206, 147, 216, 0.15);
  border-color: rgba(206, 147, 216, 0.5);
  box-shadow: 0 0 0 2px rgba(206, 147, 216, 0.15);
}

.word-text {
  font-size: clamp(0.88rem, 1.4vw, 1rem);
  font-weight: 700;
  color: var(--text-main);
  flex: 1;
}

.word-item.active .word-text {
  color: var(--accent5);
}

.word-arrow {
  font-size: 0.75rem;
  color: rgba(206, 147, 216, 0.4);
  opacity: 0;
  transition:
    opacity 0.2s,
    transform 0.2s;
}

.word-item:hover .word-arrow,
.word-item.active .word-arrow {
  opacity: 1;
  transform: translateX(3px);
}

.word-item.hidden {
  display: none;
}

.def-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  background: rgba(255, 255, 255, 0.78);
  border: 2px dashed rgba(206, 147, 216, 0.2);
  border-radius: var(--radius-xl);
  padding: 3rem 2rem;
  text-align: center;
  transition: opacity 0.3s;
}

.def-empty.hidden {
  display: none;
}

.def-empty-icon {
  font-size: 3rem;
  opacity: 0.92;
}

.def-empty p {
  font-size: 0.9rem;
  color: #0d0d0d;
  font-weight: 700;
  max-width: 220px;
  line-height: 1.6;
}

.bubble-wrap {
  display: none;
  flex-direction: column;
  gap: 0;
}

.bubble-wrap.visible {
  display: flex;
}

.bubble {
  background: var(--bubble-bg);
  border: none;
  border-radius: 20px;
  padding: 1.6rem 1.8rem;
  position: relative;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.08);
  animation: bubblePop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.word-item-definition {
  display: none;
  padding: 12px 14px 14px;
  background: rgba(206, 147, 216, 0.1);
  border-radius: 0 0 12px 12px;
  margin-top: -8px;
  border-top: 1px solid rgba(206, 147, 216, 0.2);
}

.word-item-definition.visible {
  display: block;
}

.word-item-definition-text {
  font-family: "Nunito", sans-serif;
  font-size: 0.86rem;
  color: var(--text-main);
  line-height: 1.6;
  text-align: justify;
}

@keyframes bubblePop {
  from {
    transform: scale(0.88) translateY(10px);
    opacity: 0;
  }
  to {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

.bubble-word {
  font-family: "Baloo 2", cursive;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--bubble-border);
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.bubble-word::before {
  content: "📖";
  font-size: 1rem;
}

.bubble-def {
  font-family: "Nunito", sans-serif;
  font-size: clamp(0.88rem, 1.4vw, 1rem);
  color: var(--bubble-text);
  line-height: 1.75;
  font-weight: 600;
}

.bubble-deco {
  position: absolute;
  bottom: 14px;
  right: 16px;
  display: flex;
  gap: 5px;
  opacity: 0.5;
}

.bubble-deco span {
  font-size: 0.8rem;
}

.bubble-tail {
  width: 50px;
  height: 28px;
  margin-left: 40px;
  margin-top: -2px;
  position: relative;
}

.bubble-tail svg {
  width: 100%;
  height: 100%;
}

.bubble-tail svg path {
  stroke: transparent;
}

.word-item {
  flex-direction: column;
  align-items: flex-start;
}

.word-item.active {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}
