/* Página de todos los finales: la ventana rota, cada pedazo guarda un final */
.finales-page {
  background: var(--pine-deep);
  color: var(--cream);
  min-height: 100vh;
}
.finales-page .top {
  position: static;
}

.finales {
  padding: clamp(1.5rem, 4vw, 3rem) 0 4rem;
  overflow-x: clip;
}
.finales__intro {
  width: min(100% - var(--gutter) * 2, 72rem);
  margin-inline: auto;
}
.finales__intro .eyebrow {
  color: var(--mustard);
}
.finales__intro h1 {
  margin-top: 0.5rem;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.5rem, 8vw, 5.5rem);
  line-height: 0.98;
  letter-spacing: -0.01em;
}
.finales__intro h1 em {
  font-style: normal;
  color: var(--red);
}
.finales__lede {
  max-width: 40rem;
  margin-top: 1.25rem;
  color: rgba(247, 236, 214, 0.82);
}

/* ---- los pedazos ---- */
.shards {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 2.5rem 0 0;
  padding: 0;
  list-style: none;
}
.shards li {
  display: flex;
  flex: 1 1 0;
  min-width: 0;
  transition: flex-grow 0.55s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.shard {
  --tilt: -2.5deg;
  position: relative;
  flex: 1;
  height: 11.5rem;
  padding: 0;
  border: 0;
  background: #000;
  color: var(--cream);
  font: inherit;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  transform: skewY(var(--tilt));
}
.shard img,
.shard video {
  position: absolute;
  inset: -12%;
  width: 124%;
  height: 124%;
  object-fit: cover;
  transform: skewY(calc(var(--tilt) * -1));
  transition: transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.4s ease, opacity 0.35s ease;
}
.shard img {
  filter: saturate(0.8) brightness(0.72);
}
.shard video {
  opacity: 0;
}
.shard.is-playing video {
  opacity: 1;
}
.shard::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(5, 18, 14, 0.92) 0%, rgba(5, 18, 14, 0.25) 55%, transparent 100%);
  pointer-events: none;
}
.shard__label {
  position: absolute;
  left: 1.25rem;
  right: 1.25rem;
  bottom: 1.1rem;
  z-index: 1;
  display: grid;
  gap: 0.2rem;
  transform: skewY(calc(var(--tilt) * -1));
}
.shard__num {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mustard);
}
.shard__title {
  font-size: clamp(1.6rem, 6vw, 2.25rem);
  line-height: 1;
  text-wrap: balance;
}
.shard__line {
  max-width: 24rem;
  font-size: 0.9rem;
  line-height: 1.35;
  color: rgba(247, 236, 214, 0.85);
}
.shard.is-seen .shard__num::after {
  content: ' · visto';
  color: rgba(247, 236, 214, 0.7);
}
.shard:focus-visible {
  outline: 3px solid var(--mustard);
  outline-offset: -3px;
}

/* cada final con la tipografía de su género */
.shard--superheroe .shard__title {
  font-family: 'Anton', Impact, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.shard--comic .shard__title {
  font-family: 'Bangers', 'Comic Sans MS', cursive;
  letter-spacing: 0.03em;
  color: #ffd84a;
  text-shadow: 3px 3px 0 #b8331f;
}
.shard--noir .shard__title {
  font-family: 'Special Elite', 'Courier New', monospace;
}
.shard--noir .shard__title::first-line {
  color: #ff4a36;
}
.shard--realista .shard__title {
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-weight: 700;
}

.shard--tejido .shard__title {
  font-family: var(--display);
  color: #f3c9a0;
}

/* ---- acciones y cierre ---- */
.finales__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  width: min(100% - var(--gutter) * 2, 72rem);
  margin: 2.5rem auto 0;
}
.finales__random {
  border: 0;
  cursor: pointer;
  font-family: inherit;
}
.finales__seen {
  color: rgba(247, 236, 214, 0.75);
  font-size: 0.95rem;
}
.finales__cta {
  width: min(100% - var(--gutter) * 2, 72rem);
  margin: 4rem auto 0;
  padding-top: 2rem;
  border-top: 1px solid rgba(247, 236, 214, 0.18);
}
.finales__cta h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.5rem, 4vw, 2.25rem);
}
.finales__cta p {
  max-width: 34rem;
  margin: 0.5rem 0 1rem;
  color: rgba(247, 236, 214, 0.82);
}
.finales__cta .link-arrow {
  color: var(--cream);
}

/* ---- la sala ---- */
.sala {
  width: min(94vw, 72rem);
  max-height: 94vh;
  padding: 0;
  border: 0;
  border-radius: 1rem;
  background: #06140f;
  color: var(--cream);
  overflow: hidden;
}
.sala::backdrop {
  background: rgba(3, 12, 9, 0.9);
}
.sala__video {
  display: block;
  width: 100%;
  max-height: 72vh;
  aspect-ratio: 16 / 9;
  background: #000;
}
.sala__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding: 0.9rem 1.1rem;
}
.sala__num {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mustard);
}
.sala__title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.15rem, 3vw, 1.6rem);
  line-height: 1.1;
}
.sala__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.sala__btn {
  min-height: 2.75rem;
  padding: 0.5rem 1rem;
  border: 1px solid rgba(247, 236, 214, 0.3);
  border-radius: 999px;
  background: none;
  color: var(--cream);
  font: 500 0.92rem/1 var(--body);
  cursor: pointer;
}
.sala__btn:hover {
  background: rgba(247, 236, 214, 0.1);
}
.sala__next {
  display: none;
  align-items: center;
  border-color: var(--red);
  background: var(--red);
  text-decoration: none;
}
.sala__next.is-ready {
  display: inline-flex;
  animation: listo 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes listo {
  from {
    transform: scale(0.6);
    opacity: 0;
  }
}
.sala__next:hover {
  background: var(--red-deep);
}

/* ---- escritorio: los pedazos se paran y se abren al pasar ---- */
@media (min-width: 760px) {
  .shards {
    flex-direction: row;
    gap: 8px;
    height: min(58vh, 36rem);
    min-height: 22rem;
    margin-inline: -3vw;
  }
  .shard {
    --tilt: -7deg;
    height: auto;
    transform: skewX(var(--tilt));
  }
  .shard img,
  .shard video {
    inset: 0 -30%;
    width: 160%;
    height: 100%;
    transform: skewX(calc(var(--tilt) * -1));
  }
  .shard__label {
    left: 1.75rem;
    right: 1rem;
    bottom: 1.75rem;
    transform: skewX(calc(var(--tilt) * -1));
  }
  .shards li:first-child .shard__label {
    left: calc(3vw + 3.75rem);
  }
  .shards li:last-child .shard__label {
    right: calc(3vw + 2rem);
  }
  .shard__title {
    font-size: clamp(1.5rem, 2.6vw, 2.6rem);
  }
  .shard__line {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.5s ease, opacity 0.4s ease;
  }
  .shards li:hover,
  .shards li:focus-within {
    flex-grow: 2.6;
  }
  .shards li:hover .shard img,
  .shards li:focus-within .shard img {
    filter: none;
    transform: skewX(calc(var(--tilt) * -1)) scale(1.04);
  }
  .shards li:hover .shard__line,
  .shards li:focus-within .shard__line {
    max-height: 5rem;
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .shards li,
  .shard img,
  .shard video,
  .shard__line {
    transition: none;
  }
}
