/* =====================================================================
   NUESTRO MUNDO · ajustes responsive
   ===================================================================== */

/* Tablets */
@media (max-width: 900px) {
  .featured { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .moment__card { max-width: 30rem; }
}

/* Móviles */
@media (max-width: 640px) {
  body { font-size: 1rem; }
  .btn--enter { font-size: .95rem; gap: .6rem; padding: .5rem 1.15rem .5rem .5rem; min-height: 52px; }
  .btn--enter .btn__disc { width: 36px; height: 36px; }

  .topbar { flex-direction: column; align-items: stretch; gap: .35rem; padding-bottom: .5rem; }
  .topbar__brand { font-size: .9rem; text-align: center; }
  .topbar__nav {
    overflow-x: auto; scrollbar-width: none; justify-content: flex-start;
    margin: 0 calc(var(--gutter) * -1); padding: 0 var(--gutter);
    -webkit-mask: linear-gradient(90deg, transparent, #000 1rem, #000 calc(100% - 1rem), transparent);
            mask: linear-gradient(90deg, transparent, #000 1rem, #000 calc(100% - 1rem), transparent);
  }
  .topbar__nav::-webkit-scrollbar { display: none; }
  .topbar__nav a { padding: .55rem .75rem; font-size: .88rem; }
  html { scroll-padding-top: calc(96px + var(--safe-top)); }

  .featured { grid-template-columns: 1fr 1fr; }
  .featured .song:first-of-type { grid-column: 1 / -1; }
  .featured .song:first-of-type .song__cover { aspect-ratio: 16 / 10; }

  .library { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem 1rem; }
  .library__tools { flex-direction: column; align-items: stretch; }
  .library__tools .btn { width: 100%; }
  .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: .25rem; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: none; }

  .note { grid-template-columns: 56px 1fr; }
  .note__cover { width: 56px; }
  .note .btn { grid-column: 1 / -1; justify-self: start; }

  .moment, .moment:nth-child(even) {
    justify-content: flex-end; align-items: flex-start;
    padding-top: calc(120px + var(--safe-top)); padding-bottom: 2rem;
  }
  .moment__photo { width: min(100%, 25rem); margin-bottom: 1rem; }
  .moment__photo-caption { font-size: .95rem; }
  .moment__card { padding: 1.25rem 1.3rem; }

  .stage { --floor: calc(18% + var(--dock-h)); }
  .stage__arena { height: 34%; }

  .envelope { aspect-ratio: 1.3 / 1; }

  /* Polaroids en móvil: rejilla ordenada, sin superposición, giro más leve */
  .memories__photos {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.1rem .9rem; padding: 0 .25rem;
  }
  .memories__photos[data-count="1"] { grid-template-columns: minmax(0, 250px); justify-content: center; }
  .memories__photos[data-count="3"] .polaroid:first-child { grid-column: 1 / -1; width: min(62%, 240px); justify-self: center; }
  .polaroid { width: auto; margin: 0; --lift: 0px !important; transform: rotate(calc(var(--rot) * .55)); }
  .polaroid__pie { font-size: 1.05rem; }
  .polaroid__caption { min-height: 2.8rem; }
  .memories__head { flex-direction: column; gap: .25rem; }
  .memories__hide { margin-left: 0; }
  .lightbox__figure { padding-left: .75rem; padding-right: .75rem; }
  .lightbox__nav { top: auto; bottom: calc(1rem + var(--safe-bottom)); transform: none; }

  .dock { gap: .5rem; padding-left: .6rem; padding-right: .6rem; }
  .dock__link, .dock__close { font-size: .8rem; }
}

/* Pantallas muy bajas (móvil en horizontal) */
@media (max-height: 520px) and (orientation: landscape) {
  .welcome { place-items: start center; }
  .welcome__inner { gap: .8rem; }
  .moment { padding-bottom: 3rem; }
}

/* Pantallas grandes */
@media (min-width: 1400px) {
  .library { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}
