:root {
  color-scheme: dark;
  --night: #090909;
  --gold: #bda978;
  --gold-soft: #d1c39e;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  background: var(--night);
}

body {
  overflow: hidden;
  color: #e8e4da;
  font-family: Arial, Helvetica, sans-serif;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.entry {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  min-height: 100svh;
  background:
    radial-gradient(circle at 50% 43%, rgba(231, 187, 151, 0.12), transparent 30rem),
    linear-gradient(145deg, #221014 0%, #3a1a20 58%, #1b0d11 100%);
}

.entry::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent 0,
    transparent 29px,
    rgba(238, 221, 202, 0.018) 30px,
    transparent 31px
  );
  mask-image: linear-gradient(to bottom, transparent 8%, #000 28%, #000 72%, transparent 94%);
  opacity: 0.7;
}

.entry.is-opening {
  pointer-events: none;
  animation: entry-open 1800ms var(--ease-out) forwards;
}

.device-note {
  position: absolute;
  bottom: clamp(10px, 2vh, 18px);
  top: auto;
  left: 50%;
  width: calc(100% - 32px);
  margin: 0;
  transform: translateX(-50%);
  color: rgba(232, 228, 218, 0.52);
  font-size: 14px;
  line-height: 1.4;
  text-align: center;
  letter-spacing: 0.04em;
  animation: note-in 1800ms 800ms var(--ease-out) both;
}

.entry-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: translateY(-1vh);
}

.sgf {
  margin: 0 0 clamp(84px, 10vh, 120px);
  color: #efdfbd;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(140px, 18vw, 280px);
  font-weight: 400;
  line-height: 0.82;
  letter-spacing: 0.04em;
  text-shadow: 0 0 38px rgba(189, 169, 120, 0.08);
  opacity: 0;
  animation: sgf-in 2400ms 220ms var(--ease-out) forwards;
}

.birthday {
  margin: 14px 0 0;
  color: #d4b7a0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(15px, 1.4vw, 19px);
  font-weight: 400;
  letter-spacing: 0.14em;
  opacity: 0;
  animation: quiet-in 1600ms 1100ms var(--ease-out) forwards;
}

.password-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  opacity: 0;
  animation: quiet-in 1400ms 1500ms var(--ease-out) forwards;
}

.password-label {
  margin: 0 0 22px;
  color: #dcc4b0;
  font-family: "Segoe Script", "Brush Script MT", cursive;
  font-size: clamp(42px, 4.4vw, 58px);
  line-height: 1;
  transform: rotate(-2deg);
}

.date-fields {
  display: flex;
  align-items: center;
  gap: clamp(7px, 1.2vw, 12px);
  margin: 0;
  padding: 0;
  border: 0;
}

.group {
  display: flex;
  gap: 7px;
}

.digit {
  width: clamp(50px, 5.4vw, 68px);
  height: clamp(60px, 7vw, 84px);
  margin: 0;
  border: 1px solid rgba(221, 196, 176, 0.27);
  border-radius: 2px;
  outline: 0;
  background: rgba(255, 241, 220, 0.025);
  color: rgba(239, 223, 189, 0.54);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(25px, 2.7vw, 34px);
  line-height: 1;
  text-align: center;
  caret-color: var(--gold);
  transition:
    border-color 180ms ease,
    background-color 180ms ease,
    box-shadow 180ms ease;
}

.digit::placeholder {
  color: rgba(239, 223, 189, 0.28);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  letter-spacing: 0.08em;
  opacity: 1;
}

.digit:focus {
  border-color: rgba(239, 223, 189, 0.68);
  background: rgba(255, 241, 220, 0.045);
  box-shadow: 0 0 20px rgba(231, 187, 151, 0.12);
}

.hint-button {
  margin-top: 22px;
  padding: 14px 26px 13px;
  border: 1px solid rgba(221, 196, 176, 0.32);
  border-radius: 999px;
  background: rgba(255, 241, 220, 0.025);
  color: #d2b79d;
  font-family: "Segoe Script", "Brush Script MT", cursive;
  font-size: 26px;
  cursor: pointer;
  transition:
    color 180ms ease,
    border-color 180ms ease,
    background-color 180ms ease,
    box-shadow 180ms ease;
  animation: hint-breathe 5200ms ease-in-out infinite;
}

.hint-button span {
  margin-right: 3px;
  opacity: 0.82;
}

.hint-button.is-used {
  animation: none;
  border-color: rgba(221, 196, 176, 0.22);
  box-shadow: none;
}

.need-hint,
.birthday {
  color: rgba(212, 183, 160, 0.66);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  letter-spacing: 0.04em;
  text-align: center;
}

.need-hint {
  margin: 10px 0 0;
  animation: quiet-in 900ms var(--ease-out) both;
}

.birthday.is-visible {
  animation: quiet-in 700ms var(--ease-out) both;
}

.entry-message {
  min-height: 20px;
  margin: 10px 0 0;
  color: rgba(239, 223, 189, 0.78);
  font-family: "Segoe Script", "Brush Script MT", cursive;
  font-size: 18px;
  text-align: center;
  opacity: 0;
}

.entry-message.is-visible {
  animation: quiet-in 650ms var(--ease-out) both;
}

.digit.is-correct {
  border-color: rgba(239, 223, 189, 0.82);
  background: rgba(255, 241, 220, 0.09);
  color: #efdfbd;
  box-shadow: 0 0 22px rgba(231, 187, 151, 0.18);
  transition:
    border-color 500ms ease,
    background-color 500ms ease,
    box-shadow 500ms ease,
    color 500ms ease;
}

.story-shell {
  position: relative;
  z-index: 1;
  min-height: 100svh;
  overflow: clip;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(231, 187, 151, 0.035), transparent 45rem),
    linear-gradient(145deg, rgba(34, 16, 20, 0.22), rgba(58, 26, 32, 0.14) 58%, rgba(27, 13, 17, 0.22));
  color: #f0e2d0;
  opacity: 0;
  transition: opacity 1600ms var(--ease-out);
}

.story-shell.is-visible {
  opacity: 1;
}

body.is-story {
  overflow-x: hidden;
  overflow-y: auto;
  background: #241217;
}

.cinema-lights {
  position: fixed;
  z-index: 0;
  top: -100vh;
  left: 0;
  width: 100%;
  height: 300vh;
  overflow: hidden;
  pointer-events: none;
  will-change: transform;
}

.cinema-lights::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle 54px at 15% 26%, rgba(246, 191, 157, 0.38), rgba(222, 141, 146, 0.16) 42%, transparent 100%),
    radial-gradient(circle 44px at 78% 34%, rgba(244, 216, 177, 0.34), rgba(239, 187, 151, 0.13) 45%, transparent 100%),
    radial-gradient(circle 72px at 83% 52%, rgba(190, 118, 130, 0.3), rgba(190, 118, 130, 0.1) 45%, transparent 100%),
    radial-gradient(circle 48px at 24% 62%, rgba(239, 190, 160, 0.3), rgba(227, 181, 151, 0.1) 45%, transparent 100%),
    radial-gradient(circle 58px at 60% 78%, rgba(239, 187, 151, 0.28), rgba(224, 172, 143, 0.1) 45%, transparent 100%),
    radial-gradient(ellipse 42% 32% at 50% 50%, rgba(110, 45, 54, 0.22), transparent 100%);
  background-size: 100% 100vh;
  background-repeat: repeat-y;
  filter: blur(20px);
  opacity: 0.95;
  animation: bokeh-drift 52s ease-in-out infinite alternate;
  will-change: transform;
}

.film-grain {
  position: fixed;
  z-index: 3;
  inset: 0;
  pointer-events: none;
  background-image: url("film-grain.svg");
  background-size: 180px 180px;
  opacity: 0.045;
  mix-blend-mode: soft-light;
}

.staff-thread {
  position: absolute;
  z-index: 0;
  top: 0;
  left: clamp(18px, 6vw, 92px);
  width: clamp(34px, 5vw, 70px);
  height: 900svh;
  overflow: visible;
  fill: none;
  stroke: rgba(229, 194, 164, 0.48);
  stroke-width: 0.85;
  opacity: 0.24;
  pointer-events: none;
}

.staff-thread ellipse {
  fill: rgba(229, 194, 164, 0.62);
  stroke: none;
}

.staff-thread path:nth-of-type(n + 6) {
  stroke: rgba(229, 194, 164, 0.55);
  stroke-width: 1;
}

.story {
  position: relative;
  z-index: 1;
}

.story-scene {
  position: relative;
  display: grid;
  min-height: 100svh;
  place-items: center;
  padding: 10vh clamp(50px, 15vw, 220px);
}

.story-phrase {
  max-width: 1050px;
  margin: 0;
  color: #f1e4d4;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(48px, 6.4vw, 94px);
  font-weight: 400;
  line-height: 1.16;
  text-align: center;
  text-wrap: balance;
  opacity: 0.12;
  filter: blur(7px);
  transform: translateY(10px);
  clip-path: inset(0 0 100% 0);
  transition:
    clip-path 950ms cubic-bezier(0.77, 0, 0.175, 1),
    opacity 850ms var(--ease-out),
    filter 850ms var(--ease-out),
    transform 850ms var(--ease-out);
}

.story-phrase.is-visible {
  opacity: 1;
  filter: blur(0);
  transform: translateY(0);
  clip-path: inset(0 0 0 0);
}

.story-scene-short .story-phrase {
  font-size: clamp(72px, 10vw, 138px);
}

.key-word {
  display: inline-block;
  color: #e0b8ad;
  font-family: "Segoe Script", "Brush Script MT", cursive;
  font-size: 0.9em;
  line-height: 1.05;
  transform: rotate(-3deg);
}

.scroll-cue {
  position: absolute;
  bottom: clamp(34px, 7vh, 68px);
  left: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transform: translateX(-50%);
  color: rgba(225, 194, 167, 0.63);
  font-family: "Segoe Script", "Brush Script MT", cursive;
  font-size: 26px;
  letter-spacing: 0.04em;
  animation: scroll-cue 4s ease-in-out infinite;
}

.scroll-cue span {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 36px;
}

.story-scene-note .story-phrase {
  max-width: 900px;
  color: #e2c3ad;
  font-family: "Segoe Script", "Brush Script MT", cursive;
  font-size: clamp(32px, 3.8vw, 52px);
  line-height: 1.4;
}

.story-scene-last {
  min-height: 110svh;
}

.photo-gallery {
  position: relative;
  z-index: 1;
  padding-bottom: 140px;
  background: linear-gradient(180deg, rgba(27, 13, 17, 0.12), rgba(27, 13, 17, 0.48));
}

.editorial-list {
  display: grid;
}

.photo-scene {
  display: grid;
  min-height: 100svh;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: center;
  padding: 8vh clamp(24px, 6vw, 88px);
  opacity: 0;
  transform: translateY(26px);
  transition:
    opacity 900ms var(--ease-out),
    transform 900ms var(--ease-out);
}

.photo-scene.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.photo-scene--wide-left .photo-frame {
  grid-column: 1 / span 10;
}

.photo-scene--wide-right .photo-frame {
  grid-column: 3 / span 10;
}

.photo-scene--medium-left .photo-frame {
  grid-column: 1 / span 7;
}

.photo-scene--medium-right .photo-frame {
  grid-column: 6 / span 7;
}

/* Cada foto: la imagen y, pegado debajo, su pie con número y «Descargar».
   El pie mide lo mismo que la foto, así la descarga nunca tapa caras. */
.photo-frame {
  position: relative;
  display: flex;
  width: fit-content;
  min-width: 0;
  max-width: 100%;
  flex-direction: column;
  justify-self: center;
  margin: 0;
  will-change: transform;
}

.photo-open {
  position: relative;
  display: block;
  max-width: 100%;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: rgba(255, 241, 220, 0.03);
  cursor: zoom-in;
}

.photo-open img {
  display: block;
  max-width: 100%;
  max-height: calc(86svh - 76px);
  width: auto;
  height: auto;
  object-fit: contain;
  opacity: 0;
  transition: opacity 700ms var(--ease-out);
}

.photo-frame.is-loaded .photo-open img {
  opacity: 1;
}

.photo-frame:not(.grid-photo) .photo-open {
  min-width: min(320px, 100%);
  min-height: 240px;
  box-shadow: 0 24px 70px rgba(8, 4, 6, 0.34);
}

.photo-frame.is-loaded:not(.grid-photo) .photo-open {
  min-width: 0;
  min-height: 0;
}

.photo-caption {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 12px;
}

.photo-number {
  color: rgba(234, 205, 188, 0.82);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.download-photo {
  display: inline-flex;
  min-height: 52px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 22px;
  border: 1px solid rgba(255, 242, 231, 0.88);
  border-radius: 999px;
  background: #f0d8c8;
  color: #351a22;
  font-family: Arial, sans-serif;
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition:
    transform 150ms ease-out,
    background-color 180ms ease,
    box-shadow 180ms ease;
}

.download-photo svg,
.viewer-download svg {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.download-photo:active {
  transform: scale(0.96);
}

.gallery-actions {
  display: flex;
  justify-content: center;
  padding: 7vh 20px 2vh;
}

.view-button {
  min-width: 160px;
  min-height: 56px;
  padding: 12px 30px 10px;
  border: 1px solid rgba(221, 196, 176, 0.5);
  border-radius: 999px;
  background: rgba(255, 241, 220, 0.04);
  color: #ecd3ba;
  font-family: "Segoe Script", "Brush Script MT", cursive;
  font-size: 22px;
  cursor: pointer;
  transition:
    color 180ms ease,
    border-color 180ms ease,
    background-color 180ms ease;
}

.view-button:disabled {
  opacity: 0.45;
  cursor: wait;
}

.video-section {
  position: relative;
  z-index: 1;
  padding: clamp(64px, 10vh, 120px) clamp(20px, 6vw, 88px) 12vh;
  background: linear-gradient(180deg, rgba(27, 13, 17, 0.44), rgba(27, 13, 17, 0.9));
}

.video-title {
  margin: 0 0 clamp(28px, 5vh, 54px);
  color: #efdfd1;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(30px, 5vw, 56px);
  font-weight: 400;
  text-align: center;
}

.video-list {
  display: grid;
  max-width: 1540px;
  grid-template-columns: minmax(0, 1fr);
  margin: 0 auto;
}

.video-item {
  width: 100%;
  max-width: 1440px;
  min-width: 0;
  margin: 0 auto;
}

.concert-video {
  display: block;
  width: 100%;
  max-height: 82svh;
  aspect-ratio: 16 / 9;
  border: 1px solid rgba(222, 187, 165, 0.2);
  background: #10090b;
  object-fit: contain;
}

.video-item figcaption {
  margin-top: 12px;
  color: rgba(227, 201, 174, 0.85);
  font-family: "Segoe Script", "Brush Script MT", cursive;
  font-size: 19px;
}

.video-error {
  margin: 8px 0 0;
  color: #efb8b3;
  font-size: 17px;
}

.music-player {
  position: fixed;
  z-index: 20;
  right: auto;
  bottom: max(16px, env(safe-area-inset-bottom));
  left: 50%;
  display: grid;
  width: min(1180px, calc(100vw - 32px));
  grid-template-columns: minmax(240px, 0.85fr) minmax(300px, 1fr) minmax(320px, 1.1fr);
  grid-template-rows: 72px 48px;
  grid-template-areas:
    "track controls queue"
    "track timeline queue";
  align-items: center;
  column-gap: clamp(16px, 2vw, 28px);
  row-gap: 4px;
  padding: 18px 26px calc(18px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  border: 1px solid rgba(233, 199, 183, 0.34);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(54, 24, 33, 0.98), rgba(22, 9, 14, 0.99));
  box-shadow: 0 16px 54px rgba(8, 4, 6, 0.52);
  color: #f4e8dd;
  backdrop-filter: blur(20px);
}

.music-player[hidden] {
  display: none;
}

.music-heading {
  display: flex;
  min-width: 0;
  grid-area: track;
  align-items: center;
  gap: 14px;
}

.music-art {
  position: relative;
  display: grid;
  width: 76px;
  height: 76px;
  flex: 0 0 76px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(239, 223, 209, 0.38);
  border-radius: 12px;
  background:
    radial-gradient(ellipse at 70% 22%, rgba(244, 194, 166, 0.62), transparent 38%),
    radial-gradient(ellipse at 25% 80%, rgba(139, 66, 79, 0.85), transparent 48%),
    linear-gradient(145deg, #63333d, #2b141b 76%);
  color: #f5e1d4;
  box-shadow: inset 0 0 0 4px rgba(241, 228, 212, 0.06), 0 8px 22px rgba(8, 4, 6, 0.28);
}

.music-art-title {
  transform: translateY(-3px);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 25px;
  letter-spacing: 0.12em;
  text-shadow: 0 2px 12px rgba(10, 4, 6, 0.5);
}

.music-visualizer {
  position: absolute;
  right: 0;
  bottom: 8px;
  left: 0;
  display: flex;
  height: 15px;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  opacity: 0.72;
}

.music-visualizer i {
  width: 3px;
  height: 5px;
  border-radius: 3px;
  background: #f4d8c6;
  transform: scaleY(0.55);
  transform-origin: bottom;
}

.music-art.is-playing .music-visualizer i {
  animation: music-bars 640ms ease-in-out infinite alternate;
}

.music-art.is-playing .music-visualizer i:nth-child(2) {
  animation-delay: 160ms;
}

.music-art.is-playing .music-visualizer i:nth-child(3) {
  animation-delay: 320ms;
}

.music-art.is-playing .music-visualizer i:nth-child(4) {
  animation-delay: 80ms;
}

.music-details {
  min-width: 0;
}

.music-kicker,
.music-track-name {
  overflow: hidden;
  margin: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.music-kicker {
  color: rgba(234, 205, 188, 0.72);
  font-size: 14px;
  letter-spacing: 0.13em;
  line-height: 1.2;
  text-transform: uppercase;
}

.music-track-name {
  margin-top: 5px;
  color: #fff3e8;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.15;
}

.music-status {
  margin: 5px 0 0;
  color: rgba(234, 205, 188, 0.72);
  font-size: 16px;
  letter-spacing: 0.02em;
  line-height: 1.25;
}

.music-controls {
  display: flex;
  min-width: 0;
  grid-area: controls;
  align-items: center;
  justify-content: center;
  gap: 22px;
}

.music-control {
  display: grid;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: rgba(246, 232, 220, 0.82);
  cursor: pointer;
  transition:
    transform 150ms ease-out,
    background-color 180ms ease,
    color 180ms ease;
}

.music-control svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.music-control:active:not(:disabled) {
  transform: scale(0.96);
}

.music-toggle {
  width: 60px;
  height: 60px;
  border-color: #f4e1d4;
  background: #f4e1d4;
  box-shadow: 0 0 0 4px rgba(244, 225, 212, 0.1), 0 7px 22px rgba(15, 5, 9, 0.28);
  color: #351a22;
}

.music-toggle svg {
  width: 24px;
  height: 24px;
}

.music-toggle .music-icon-play {
  fill: currentColor;
  stroke: none;
}

.music-icon-pause,
.music-toggle.is-playing .music-icon-play {
  display: none;
}

.music-toggle.is-playing .music-icon-pause {
  display: block;
}

.music-control:disabled {
  opacity: 0.4;
  cursor: default;
}

.music-timeline {
  display: grid;
  min-width: 0;
  grid-area: timeline;
  grid-template-columns: 40px minmax(0, 1fr) 40px;
  align-items: center;
  gap: 12px;
}

.music-time {
  color: rgba(235, 213, 199, 0.76);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.music-progress {
  width: 100%;
  height: 24px;
  margin: 0;
  appearance: none;
  background: transparent;
  cursor: pointer;
}

.music-progress::-webkit-slider-runnable-track {
  height: 5px;
  border-radius: 999px;
  background: linear-gradient(
    to right,
    #f0d8c8 0%,
    #f0d8c8 var(--progress, 0%),
    rgba(244, 228, 216, 0.24) var(--progress, 0%),
    rgba(244, 228, 216, 0.24) 100%
  );
}

.music-progress::-moz-range-track {
  height: 5px;
  border-radius: 999px;
  background: rgba(244, 228, 216, 0.24);
}

.music-progress::-moz-range-progress {
  height: 5px;
  border-radius: 999px;
  background: #f0d8c8;
}

.music-progress::-webkit-slider-thumb {
  width: 14px;
  height: 14px;
  margin-top: -4.5px;
  appearance: none;
  border: 3px solid #f4e1d4;
  border-radius: 50%;
  background: #351a22;
  box-shadow: 0 0 0 3px rgba(240, 217, 200, 0.13);
}

.music-progress::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 3px solid #f4e1d4;
  border-radius: 50%;
  background: #351a22;
  box-shadow: 0 0 0 3px rgba(240, 217, 200, 0.13);
}

.music-progress:disabled {
  cursor: default;
  opacity: 0.5;
}

.music-actions {
  display: flex;
  min-width: 0;
  grid-area: queue;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
}

.music-track-meta {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.music-track-label,
.music-select-label {
  color: rgba(234, 205, 188, 0.7);
  font-size: 18px;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
}

.music-track-number {
  flex: 0 0 auto;
  color: #f4e1d4;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.music-select {
  position: relative;
  display: grid;
  min-width: 0;
  gap: 8px;
}

.music-select select {
  width: 100%;
  min-height: 68px;
  padding: 0 50px 0 18px;
  border: 1px solid rgba(234, 205, 188, 0.34);
  border-radius: 10px;
  appearance: none;
  background-color: rgba(255, 241, 220, 0.07);
  color: #fff0e4;
  font: 18px/1.2 Arial, sans-serif;
  text-overflow: ellipsis;
  cursor: pointer;
}

.music-select::after {
  position: absolute;
  right: 22px;
  bottom: 28px;
  width: 15px;
  height: 15px;
  transform: rotate(45deg);
  border-right: 2.5px solid rgba(244, 225, 212, 0.9);
  border-bottom: 2.5px solid rgba(244, 225, 212, 0.9);
  content: "";
  pointer-events: none;
}

.music-select option {
  background: #261318;
  color: #f1e4d4;
}

.view-button:focus-visible,
.photo-open:focus-visible,
.icon-button:focus-visible,
.viewer-arrow:focus-visible,
.download-photo:focus-visible,
.viewer-download:focus-visible,
.viewer-auto:focus-visible,
.gallery-chip:focus-visible,
.music-expand:focus-visible,
.music-control:focus-visible,
.music-select select:focus-visible,
.music-progress:focus-visible {
  outline: 2px solid #e3c9ae;
  outline-offset: 3px;
}

@media (hover: hover) and (pointer: fine) {
  .music-control:not(:disabled):hover {
    border-color: rgba(240, 217, 200, 0.75);
    background: rgba(240, 217, 200, 0.12);
    color: #fff4ea;
  }

  .music-toggle:not(:disabled):hover {
    transform: scale(1.04);
    background: #fff1e5;
    color: #29151a;
  }

  .music-select select:hover {
    border-color: rgba(240, 217, 200, 0.62);
  }

  .viewer-auto:hover,
  .icon-button:hover,
  .viewer-arrow:hover:not(:disabled),
  .gallery-chip:hover,
  .music-expand:hover {
    border-color: rgba(240, 217, 200, 0.72);
    background: rgba(240, 217, 200, 0.12);
    color: #fff0e4;
  }

  .view-button:hover:not(:disabled) {
    border-color: rgba(240, 217, 200, 0.72);
    background: rgba(240, 217, 200, 0.08);
    color: #fff0e4;
  }

  .download-photo:hover,
  .viewer-download:hover {
    transform: translateY(-2px);
    background: #fff1e5;
    box-shadow: 0 12px 28px rgba(15, 5, 9, 0.46);
  }
}

.gallery-error {
  padding: 24px;
  color: #e3c9ae;
  text-align: center;
}

.all-photos-dialog,
.photo-viewer {
  position: fixed;
  inset: 2vh 2vw;
  width: 96vw;
  height: 96vh;
  max-width: none;
  max-height: none;
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(222, 187, 165, 0.24);
  border-radius: 8px;
  background: #261318;
  color: #f1e4d4;
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 300ms var(--ease-out),
    transform 300ms var(--ease-out);
}

.all-photos-dialog[open],
.photo-viewer[open] {
  opacity: 1;
  transform: translateY(0);
}

.all-photos-dialog::backdrop,
.photo-viewer::backdrop {
  background: rgba(13, 7, 9, 0.82);
  backdrop-filter: blur(8px);
}

@starting-style {
  .all-photos-dialog[open],
  .photo-viewer[open] {
    opacity: 0;
    transform: translateY(8px);
  }
}

.all-photos-panel {
  display: flex;
  height: 100%;
  flex-direction: column;
}

.all-photos-toolbar,
.viewer-toolbar {
  display: flex;
  min-height: 64px;
  flex: 0 0 auto;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  border-bottom: 1px solid rgba(222, 187, 165, 0.16);
}

.all-photos-toolbar p {
  flex: 1;
  margin: 0;
  color: #e3c9ae;
  font-family: "Segoe Script", "Brush Script MT", cursive;
  font-size: 20px;
}

.icon-button {
  display: grid;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(222, 187, 165, 0.36);
  border-radius: 50%;
  background: rgba(255, 241, 220, 0.04);
  color: #f1e4d4;
  font: 30px/1 Georgia, "Times New Roman", serif;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 180ms ease, border-color 180ms ease, transform 150ms ease-out;
}

.icon-button:active {
  transform: scale(0.96);
}

/* «Ver todas»: miniaturas completas (sin recortar) con su pie debajo */
.all-photo-grid {
  display: grid;
  flex: 1;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  align-content: start;
  gap: 22px 16px;
  padding: 20px;
  overflow: auto;
  overscroll-behavior: contain;
}

.grid-photo {
  width: 100%;
}

.grid-photo .photo-open {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 4px;
  background: rgba(5, 4, 4, 0.4);
}

.grid-photo .photo-open img {
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: contain;
}

.grid-photo .photo-caption {
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 8px;
}

.grid-photo .photo-number {
  font-size: 16px;
}

.grid-photo .download-photo {
  min-height: 44px;
  flex: 1 0 auto;
  gap: 7px;
  padding: 0 14px;
  font-size: 15px;
}

.grid-photo .download-photo svg {
  width: 19px;
  height: 19px;
}

/* Visor a pantalla completa */
.photo-viewer {
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  border: 0;
  border-radius: 0;
  background: rgba(25, 12, 16, 0.97);
}

.viewer-toolbar {
  position: absolute;
  z-index: 2;
  top: 0;
  right: 0;
  left: 0;
  min-height: 76px;
  gap: 10px;
  padding: 14px 20px;
  border-bottom: 0;
  background: linear-gradient(180deg, rgba(25, 12, 16, 0.92), rgba(25, 12, 16, 0));
}

.viewer-counter {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 12px;
  margin: 0 auto 0 0;
  color: rgba(241, 228, 212, 0.7);
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.viewer-counter b {
  color: #f4e1d4;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 21px;
  font-weight: 400;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.viewer-counter span {
  white-space: nowrap;
}

.viewer-auto,
.viewer-download {
  display: inline-flex;
  min-height: 48px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 20px;
  border-radius: 999px;
  font-family: Arial, sans-serif;
  font-size: 16px;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 180ms ease, border-color 180ms ease, transform 150ms ease-out, box-shadow 180ms ease;
}

.viewer-auto {
  border: 1px solid rgba(222, 187, 165, 0.36);
  background: rgba(255, 241, 220, 0.04);
  color: #f1e4d4;
}

.viewer-auto[aria-pressed="true"] {
  border-color: rgba(240, 217, 200, 0.7);
  background: rgba(240, 217, 200, 0.16);
}

.viewer-auto-icon {
  min-width: 1em;
  font-size: 13px;
  text-align: center;
}

.viewer-download {
  border: 1px solid rgba(255, 242, 231, 0.88);
  background: #f0d8c8;
  color: #351a22;
  font-weight: 700;
}

.viewer-auto:active,
.viewer-download:active {
  transform: scale(0.97);
}

.viewer-stage {
  display: grid;
  width: 100%;
  height: 100%;
  grid-template-columns: minmax(60px, 9vw) minmax(0, 1fr) minmax(60px, 9vw);
  grid-template-rows: minmax(0, 1fr);
  align-items: center;
  justify-items: center;
  padding: 80px 14px 28px;
}

.viewer-figure {
  display: grid;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  place-items: center;
  margin: 0;
}

.viewer-figure img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  opacity: 0;
  transition: opacity 320ms var(--ease-out);
}

.viewer-figure img.is-loaded {
  opacity: 1;
}

.viewer-image-error {
  color: #e3c9ae;
  font-family: Georgia, "Times New Roman", serif;
  text-align: center;
}

.viewer-arrow {
  display: grid;
  width: 60px;
  height: 60px;
  place-items: center;
  border: 1px solid rgba(222, 187, 165, 0.34);
  border-radius: 50%;
  background: rgba(32, 16, 20, 0.6);
  color: #f1e4d4;
  font: 40px/1 Georgia, "Times New Roman", serif;
  cursor: pointer;
  transition: background-color 180ms ease, border-color 180ms ease, opacity 180ms ease, transform 150ms ease-out;
}

.viewer-arrow:active:not(:disabled) {
  transform: scale(0.96);
}

.viewer-figure img {
  cursor: pointer;
}

.viewer-arrow:disabled {
  opacity: 0.22;
  cursor: default;
}

@keyframes bokeh-drift {
  from { transform: translate3d(-1.5%, -0.5%, 0) scale(1); }
  to { transform: translate3d(1.5%, 0.8%, 0) scale(1.04); }
}

@keyframes scroll-cue {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 0.95; }
}

@media (max-width: 600px) {
  .staff-thread {
    left: 8px;
    width: 30px;
    opacity: 0.18;
  }

  .story-scene {
    padding: 12vh 48px;
  }

  .story-phrase {
    font-size: clamp(38px, 10vw, 58px);
    line-height: 1.2;
  }

  .story-scene-short .story-phrase {
    font-size: clamp(62px, 15vw, 90px);
  }

  .story-scene-note .story-phrase {
    font-size: clamp(27px, 7vw, 36px);
    line-height: 1.38;
  }

  .scroll-cue {
    font-size: 22px;
  }

  .scroll-cue span {
    font-size: 30px;
  }

  .need-hint {
    font-size: 17px;
  }

  .birthday {
    font-size: 18px;
  }

  .photo-scene {
    min-height: 78svh;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    padding: 7vh 18px;
  }

  .photo-scene--wide-left .photo-frame,
  .photo-scene--wide-right .photo-frame {
    grid-column: 1 / span 6;
  }

  .photo-scene--medium-left .photo-frame {
    grid-column: 1 / span 5;
  }

  .photo-scene--medium-right .photo-frame {
    grid-column: 2 / span 5;
  }

  .photo-open img {
    max-height: calc(80svh - 70px);
  }

  .all-photos-dialog {
    inset: 1vh 1vw;
    width: 98vw;
    height: 98vh;
  }

  .all-photo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 10px;
    padding: 12px;
  }

  .grid-photo .download-photo {
    flex-basis: 100%;
  }

  .video-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .video-title {
    text-align: left;
  }

}

@media (max-width: 1050px) {
  .music-player {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 320px);
    grid-template-rows: auto auto auto;
    grid-template-areas:
      "track queue"
      "controls controls"
      "timeline timeline";
    column-gap: 12px;
    row-gap: 8px;
    padding: 14px 20px calc(14px + env(safe-area-inset-bottom));
  }

  .music-track-label,
  .music-select-label {
    font-size: 16px;
  }

  .music-track-number {
    font-size: 16px;
  }

  .music-select select {
    min-height: 62px;
    padding-left: 14px;
    font-size: 17px;
  }

  .music-select::after {
    right: 20px;
    bottom: 26px;
  }

}

@media (max-width: 920px) {
  .music-player {
    grid-template-columns: minmax(0, 1fr) minmax(220px, 240px);
    grid-template-rows: auto auto auto;
    grid-template-areas:
      "track queue"
      "controls controls"
      "timeline timeline";
    column-gap: 12px;
    row-gap: 8px;
    padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
  }

  .music-heading {
    gap: 10px;
  }

  .music-art {
    width: 56px;
    height: 56px;
    flex-basis: 56px;
    border-radius: 10px;
  }

  .music-art-title {
    font-size: 20px;
  }

  .music-controls {
    gap: 16px;
  }

  .music-control {
    width: 44px;
    height: 44px;
  }

  .music-toggle {
    width: 52px;
    height: 52px;
  }

  .music-timeline {
    grid-template-columns: 42px minmax(0, 1fr) 42px;
    gap: 10px;
  }

  .music-actions {
    gap: 8px;
  }

  .music-track-label,
  .music-select-label {
    font-size: 15px;
  }

  .music-select select {
    min-height: 60px;
    padding-left: 12px;
    font-size: 17px;
  }

  .music-select::after {
    right: 18px;
    bottom: 26px;
  }
}

@media (max-width: 380px) {
  .music-player {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto auto;
    grid-template-areas:
      "track"
      "controls"
      "timeline"
      "queue";
    row-gap: 7px;
    padding: 11px 14px calc(12px + env(safe-area-inset-bottom));
  }

  .music-art {
    width: 50px;
    height: 50px;
    flex-basis: 50px;
  }

  .music-track-name {
    font-size: 19px;
  }

  .music-status {
    font-size: 14px;
  }

  .music-controls {
    gap: 12px;
  }

  .music-timeline {
    grid-template-columns: 38px minmax(0, 1fr) 38px;
    gap: 8px;
  }

  .music-select select {
    min-height: 60px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cinema-lights::before,
  .scroll-cue {
    animation: none;
  }

  .story-phrase {
    filter: none;
    transform: none;
    transition:
      clip-path 500ms ease,
      opacity 500ms ease;
  }

  .photo-scene {
    transform: none;
    transition: opacity 500ms ease;
  }

  .photo-frame {
    transform: none !important;
  }

  .all-photos-dialog,
  .photo-viewer {
    transform: none;
    transition: opacity 220ms ease;
  }
}

.slash {
  color: rgba(209, 195, 158, 0.5);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(18px, 2vw, 24px);
}

.date-fields.is-wrong {
  animation: shake 420ms ease;
}

.opening {
  position: fixed;
  z-index: 10;
  inset: 0;
  background: #090909;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.opening.is-visible {
  visibility: visible;
  animation: opening-fade 1800ms var(--ease-out) forwards;
}

@keyframes sgf-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes quiet-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes note-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes entry-open {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes opening-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(3px); }
}

@keyframes hint-breathe {
  0%, 82%, 100% {
    box-shadow: 0 0 0 rgba(231, 187, 151, 0);
    border-color: rgba(221, 196, 176, 0.32);
  }
  88% {
    box-shadow: 0 0 18px rgba(231, 187, 151, 0.11);
    border-color: rgba(239, 223, 189, 0.52);
  }
  94% {
    box-shadow: 0 0 6px rgba(231, 187, 151, 0.06);
  }
}

@media (hover: hover) and (pointer: fine) {
  .hint-button:hover {
    border-color: rgba(239, 223, 189, 0.58);
    background: rgba(255, 241, 220, 0.055);
    color: #efdfbd;
  }
}

@media (max-width: 560px) {
  .entry-center {
    width: 100%;
  }

  .sgf {
    font-size: clamp(104px, 30vw, 150px);
    margin-bottom: clamp(56px, 10vh, 72px);
  }

  .password-label {
    margin-bottom: 18px;
    font-size: clamp(36px, 9vw, 46px);
  }

  .birthday {
    margin-bottom: 0;
  }

  .date-fields {
    gap: 4px;
  }

  .group {
    gap: 4px;
  }

  .digit {
    width: clamp(34px, 10vw, 40px);
    height: 58px;
    font-size: clamp(22px, 6.8vw, 25px);
  }

  .digit::placeholder {
    font-size: 16px;
  }

  .hint-button {
    margin-top: 18px;
    padding: 11px 20px;
    font-size: 21px;
  }

  .slash {
    font-size: 16px;
  }
}

@media (max-height: 620px) {
  .sgf {
    margin-bottom: 38px;
  }

  .device-note {
    bottom: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sgf,
  .birthday,
  .password-form,
  .device-note {
    animation-duration: 220ms;
  }

  .entry.is-opening,
  .opening.is-visible,
  .date-fields.is-wrong {
    animation-duration: 220ms;
  }

  .hint-button {
    animation: none;
  }
}

@media (min-width: 381px) and (max-width: 520px) {
  .music-player {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto auto;
    grid-template-areas:
      "track"
      "controls"
      "timeline"
      "queue";
    row-gap: 7px;
    padding: 11px 14px calc(12px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 380px) {
  .date-fields {
    gap: 5px;
  }

  .group {
    gap: 3px;
  }

  .digit {
    width: clamp(30px, 9.5vw, 36px);
    height: 54px;
  }
}


@media (prefers-reduced-motion: reduce) {
  .photo-open img,
  .viewer-figure img {
    transition-duration: 220ms;
  }

  .download-photo,
  .viewer-download,
  .viewer-auto,
  .viewer-arrow,
  .icon-button,
  .music-control {
    transition-duration: 0ms;
  }

  .music-visualizer i {
    animation: none;
    transform: scaleY(0.75);
  }

  .download-photo:active,
  .viewer-download:active,
  .viewer-auto:active,
  .viewer-arrow:active:not(:disabled),
  .icon-button:active,
  .music-control:active:not(:disabled),
  .music-toggle:hover,
  .download-photo:hover,
  .viewer-download:hover {
    transform: none;
  }

  .music-player.is-switching {
    animation: none;
  }
}

@keyframes music-bars {
  to { transform: scaleY(1.7); }
}

/* ===== Reproductor plegado =====
   Por defecto es una barra compacta (canción + reproducir/pausar) para no tapar
   las fotos. Tocando el título o la flecha se abre el reproductor completo. */
.music-expand {
  display: none;
}

.music-player:not([hidden]) .music-expand {
  display: inline-flex;
  min-width: 48px;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 12px;
  border: 1px solid rgba(234, 205, 188, 0.4);
  border-radius: 999px;
  background: rgba(54, 24, 33, 0.98);
  color: #f4e1d4;
  font: 600 15px/1 Arial, sans-serif;
  cursor: pointer;
  transition: background-color 180ms ease, border-color 180ms ease, transform 150ms ease-out;
}

.music-expand svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  transition: transform 220ms var(--ease-out);
}

.music-expand:active {
  transform: scale(0.96);
}

/* Abierto: la flecha es un asa sobre el borde superior para plegarlo */
.music-player:not(.is-collapsed) {
  padding-top: 34px;
}

.music-player:not(.is-collapsed) .music-expand {
  position: absolute;
  top: -25px;
  left: 50%;
  translate: -50% 0;
  padding: 0 18px;
  box-shadow: 0 6px 18px rgba(8, 4, 6, 0.4);
}

.music-player:not(.is-collapsed) .music-expand svg {
  transform: rotate(180deg);
}

.music-player.is-collapsed {
  right: max(20px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  left: auto;
  width: min(460px, calc(100vw - 24px));
  grid-template-columns: minmax(0, 1fr) auto auto;
  grid-template-rows: auto;
  grid-template-areas: "track controls expand";
  column-gap: 10px;
  row-gap: 0;
  padding: 10px 10px 13px 10px;
  overflow: hidden;
  transform: none;
  border-radius: 18px;
}

.music-player.is-collapsed::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: var(--progress, 0%);
  height: 3px;
  background: #f0d8c8;
  pointer-events: none;
}

.music-player.is-collapsed .music-expand {
  grid-area: expand;
  padding: 0;
  width: 48px;
}

.music-player.is-collapsed .music-expand-label,
.music-player.is-collapsed .music-kicker,
.music-player.is-collapsed .music-timeline,
.music-player.is-collapsed .music-actions,
.music-player.is-collapsed #music-previous,
.music-player.is-collapsed #music-next {
  display: none;
}

.music-player.is-collapsed .music-heading {
  gap: 12px;
  cursor: pointer;
}

.music-player.is-collapsed .music-art {
  width: 52px;
  height: 52px;
  flex-basis: 52px;
  border-radius: 10px;
}

.music-player.is-collapsed .music-art-title {
  font-size: 17px;
}

.music-player.is-collapsed .music-visualizer {
  bottom: 5px;
  height: 11px;
}

.music-player.is-collapsed .music-track-name {
  margin-top: 0;
  font-size: 19px;
}

.music-player.is-collapsed .music-status {
  margin-top: 3px;
  overflow: hidden;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.music-player.is-collapsed .music-controls {
  gap: 0;
}

.music-player.is-collapsed .music-toggle {
  width: 52px;
  height: 52px;
}

.music-player.is-switching {
  animation: player-switch 360ms var(--ease-out);
}

@keyframes player-switch {
  from {
    opacity: 0.2;
    translate: 0 10px;
  }
}

@media (max-width: 600px) {
  .music-player.is-collapsed {
    right: 10px;
    bottom: max(10px, env(safe-area-inset-bottom));
    width: calc(100vw - 20px);
  }

  .music-player:not(.is-collapsed) {
    bottom: max(10px, env(safe-area-inset-bottom));
    width: calc(100vw - 20px);
  }
}

/* ===== Indicador de la galería: por qué foto vas y acceso a «Ver todas» ===== */
.gallery-chip {
  position: fixed;
  z-index: 15;
  top: max(16px, env(safe-area-inset-top));
  right: max(16px, env(safe-area-inset-right));
  display: inline-flex;
  min-height: 52px;
  align-items: center;
  gap: 12px;
  padding: 6px 6px 6px 18px;
  border: 1px solid rgba(234, 205, 188, 0.34);
  border-radius: 999px;
  background: rgba(36, 16, 22, 0.82);
  box-shadow: 0 10px 30px rgba(8, 4, 6, 0.35);
  color: rgba(244, 225, 212, 0.8);
  font: 16px/1 Arial, sans-serif;
  cursor: pointer;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  animation: quiet-in 500ms var(--ease-out) both;
  transition: background-color 180ms ease, border-color 180ms ease, transform 150ms ease-out;
}

.gallery-chip:active {
  transform: scale(0.97);
}

.gallery-chip-count {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.gallery-chip-count b {
  color: #fff3e8;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  font-weight: 400;
}

.gallery-chip-action {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  padding: 0 16px;
  border-radius: 999px;
  background: #f0d8c8;
  color: #351a22;
  font-weight: 700;
  white-space: nowrap;
}

/* Visor en móvil: flechas y «Automático» abajo, al alcance del pulgar */
@media (max-width: 600px) {
  .viewer-toolbar {
    min-height: 72px;
    gap: 8px;
    padding: 12px 12px 12px 16px;
  }

  .viewer-counter {
    flex-direction: column;
    gap: 3px;
    font-size: 15px;
  }

  .viewer-counter b {
    font-size: 20px;
  }

  .photo-viewer .viewer-auto {
    position: fixed;
    z-index: 2;
    bottom: max(18px, env(safe-area-inset-bottom));
    left: 50%;
    min-height: 56px;
    translate: -50% 0;
  }

  .viewer-stage {
    grid-template-columns: minmax(0, 1fr);
    padding: 76px 6px 96px;
  }

  .viewer-figure {
    grid-row: 1;
    grid-column: 1;
  }

  .viewer-arrow {
    position: absolute;
    z-index: 2;
    bottom: max(16px, env(safe-area-inset-bottom));
    width: 60px;
    height: 60px;
  }

  #previous-photo {
    left: 16px;
  }

  #next-photo {
    right: 16px;
  }

  .gallery-chip {
    top: max(10px, env(safe-area-inset-top));
    right: 10px;
    min-height: 48px;
    gap: 10px;
    padding-left: 14px;
    font-size: 15px;
  }

  .gallery-chip-action {
    min-height: 38px;
    padding: 0 14px;
  }
}

/* ===== Descargar todas (ZIP) ===== */
.gallery-actions {
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}

.zip-button {
  display: inline-flex;
  min-height: 56px;
  align-items: center;
  gap: 10px;
  padding: 0 26px;
  border: 1px solid rgba(255, 242, 231, 0.88);
  border-radius: 999px;
  background: #f0d8c8;
  color: #351a22;
  font: 700 18px/1.2 Arial, sans-serif;
  text-decoration: none;
  transition: transform 150ms ease-out, background-color 180ms ease;
}

.zip-button small {
  font-size: 15px;
  font-weight: 400;
  opacity: 0.8;
}

.zip-button svg {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.zip-button--compact {
  min-height: 48px;
  padding: 0 18px;
  font-size: 16px;
}

.zip-button:active {
  transform: scale(0.97);
}

@media (hover: hover) and (pointer: fine) {
  .zip-button:hover {
    background: #fff1e5;
  }

  .lyrics-toggle:hover {
    border-color: rgba(240, 217, 200, 0.75);
    background: rgba(240, 217, 200, 0.14);
  }

  .lyrics-panel.is-synced .lyrics-line:hover {
    color: rgba(255, 243, 232, 0.9);
  }
}

/* ===== Botón «Letra» del reproductor ===== */
.lyrics-toggle {
  display: inline-flex;
  min-height: 48px;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  margin-left: 4px;
  padding: 0 16px;
  border: 1px solid rgba(234, 205, 188, 0.42);
  border-radius: 999px;
  background: rgba(255, 241, 220, 0.05);
  color: #f4e1d4;
  font: 600 16px/1 Arial, sans-serif;
  cursor: pointer;
  transition: background-color 180ms ease, border-color 180ms ease, transform 150ms ease-out;
}

.lyrics-toggle svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 2;
}

.lyrics-toggle.is-active {
  border-color: #f0d8c8;
  background: #f0d8c8;
  color: #351a22;
}

.lyrics-toggle:active {
  transform: scale(0.96);
}

.music-player.is-collapsed .music-controls {
  gap: 8px;
}

/* ===== Panel de letra ===== */
.lyrics-panel {
  position: fixed;
  z-index: 19;
  top: 0;
  right: 0;
  bottom: 0;
  display: flex;
  width: min(560px, 46vw);
  flex-direction: column;
  border-left: 1px solid rgba(234, 205, 188, 0.2);
  background:
    radial-gradient(ellipse at 30% 10%, rgba(139, 66, 79, 0.45), transparent 60%),
    linear-gradient(180deg, #3a1a21, #180a0f);
  box-shadow: -20px 0 60px rgba(8, 4, 6, 0.45);
  color: #f4e1d4;
  animation: lyrics-in 420ms var(--ease-out);
}

@keyframes lyrics-in {
  from {
    opacity: 0;
    translate: 40px 0;
  }
}

.lyrics-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px 24px 14px 32px;
}

.lyrics-heading {
  min-width: 0;
  flex: 1;
}

.lyrics-kicker {
  margin: 0;
  color: rgba(234, 205, 188, 0.75);
  font: 15px/1.2 Arial, sans-serif;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.lyrics-title {
  overflow: hidden;
  margin: 4px 0 0;
  font: 400 26px/1.2 Georgia, "Times New Roman", serif;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lyrics-body {
  position: relative;
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px 32px 45vh;
  scrollbar-width: thin;
  scrollbar-color: rgba(234, 205, 188, 0.3) transparent;
  mask-image: linear-gradient(to bottom, transparent 0, #000 40px, #000 calc(100% - 140px), transparent 100%);
}

.lyrics-note {
  margin: 0 0 22px;
  color: rgba(234, 205, 188, 0.75);
  font: 17px/1.4 Arial, sans-serif;
}

.lyrics-lines {
  margin: 0;
  padding: 0;
  list-style: none;
}

.lyrics-line {
  margin: 0 0 14px;
  color: rgba(255, 243, 232, 0.88);
  font: 700 clamp(24px, 2.1vw, 32px)/1.28 Georgia, "Times New Roman", serif;
  text-wrap: balance;
  transform-origin: left center;
  transition: color 380ms ease, opacity 380ms ease, transform 380ms var(--ease-out);
}

.lyrics-line.is-break {
  margin-top: 34px;
}

/* Sincronizada: lo que ya sonó en tenue, lo que viene apagado y la línea actual encendida */
.lyrics-panel.is-synced .lyrics-line {
  color: rgba(255, 243, 232, 0.34);
  cursor: pointer;
}

.lyrics-panel.is-synced .lyrics-line.is-past {
  color: rgba(255, 243, 232, 0.6);
}

.lyrics-panel.is-synced .lyrics-line.is-active {
  color: #fff6ee;
  text-shadow: 0 0 22px rgba(244, 194, 166, 0.35);
  transform: scale(1.03);
}

.lyrics-line.is-next {
  outline: 2px dashed rgba(240, 216, 200, 0.6);
  outline-offset: 6px;
  border-radius: 4px;
}

/* Modo sincronizar */
.lyrics-sync {
  margin: 0 24px 10px 32px;
  padding: 14px 16px;
  border: 1px solid rgba(240, 216, 200, 0.4);
  border-radius: 12px;
  background: rgba(255, 241, 220, 0.06);
  font: 15px/1.4 Arial, sans-serif;
}

.lyrics-sync-help,
.lyrics-sync-status {
  margin: 0;
}

.lyrics-sync-status {
  margin-top: 10px;
  color: #fff3e8;
  font-weight: 700;
}

.lyrics-sync kbd {
  padding: 1px 6px;
  border: 1px solid rgba(240, 216, 200, 0.5);
  border-radius: 4px;
  font: inherit;
}

.lyrics-sync-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.lyrics-sync-buttons button {
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid rgba(240, 216, 200, 0.45);
  border-radius: 999px;
  background: transparent;
  color: #f4e1d4;
  font: 600 15px/1 Arial, sans-serif;
  cursor: pointer;
}

.lyrics-sync-buttons .is-primary {
  border-color: #f0d8c8;
  background: #f0d8c8;
  color: #351a22;
}

/* Con la letra abierta, el reproductor plegado se coloca bajo el panel */
body:has(.lyrics-panel:not([hidden])) .music-player.is-collapsed {
  right: 20px;
  width: min(520px, calc(46vw - 40px));
}

@media (max-width: 900px) {
  .lyrics-panel {
    left: 0;
    width: auto;
    border-left: 0;
  }

  body:has(.lyrics-panel:not([hidden])) .music-player.is-collapsed {
    width: min(460px, calc(100vw - 24px));
  }
}

@media (max-width: 600px) {
  .lyrics-header {
    padding: 16px 14px 10px 20px;
  }

  .lyrics-title {
    font-size: 22px;
  }

  .lyrics-body {
    padding: 8px 20px 45vh;
  }

  .lyrics-line {
    font-size: 25px;
  }

  .lyrics-sync {
    margin: 0 14px 8px 20px;
  }

  body:has(.lyrics-panel:not([hidden])) .music-player.is-collapsed {
    right: 10px;
    width: calc(100vw - 20px);
  }

  /* Barra plegada en móvil: sin carátula, para que quepan el título y «Letra» */
  .music-player.is-collapsed .music-art {
    display: none;
  }

  .lyrics-toggle {
    padding: 0 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lyrics-panel {
    animation: none;
  }

  .lyrics-line {
    transition: none;
  }

  .lyrics-panel.is-synced .lyrics-line.is-active {
    transform: none;
  }
}

/* ===== Letra en directo sobre la galería ===== */
.lyrics-stage {
  position: fixed;
  z-index: 4;
  top: 50%;
  left: clamp(56px, 8.5vw, 150px);
  display: grid;
  width: calc(40vw - clamp(56px, 8.5vw, 150px) - 36px);
  grid-template-rows: auto auto;
  translate: 0 -50%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 700ms var(--ease-out);
}

.lyrics-stage.is-visible {
  opacity: 1;
}

.lyrics-stage-song {
  grid-row: 1;
  margin: 0 0 18px;
  color: rgba(224, 184, 173, 0.78);
  font-family: "Segoe Script", "Brush Script MT", cursive;
  font-size: 22px;
  line-height: 1.2;
}

.lyrics-stage-song::before {
  content: "♪ ";
  font-family: Georgia, "Times New Roman", serif;
}

.lyrics-stanza {
  grid-row: 2;
  grid-column: 1;
  opacity: 0;
}

.lyrics-stanza.is-in {
  animation: stanza-in 900ms var(--ease-out) forwards;
}

.lyrics-stanza.is-out {
  animation: stanza-out 700ms ease forwards;
}

@keyframes stanza-in {
  from {
    opacity: 0;
    filter: blur(6px);
    translate: 0 18px;
  }
  to {
    opacity: 1;
    filter: blur(0);
    translate: 0 0;
  }
}

@keyframes stanza-out {
  from {
    opacity: 1;
    filter: blur(0);
    translate: 0 0;
  }
  to {
    opacity: 0;
    filter: blur(5px);
    translate: 0 -14px;
  }
}

.stage-line {
  margin: 0 0 0.38em;
  color: rgba(255, 243, 232, 0.36);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(28px, 2.45vw, 40px);
  line-height: 1.26;
  text-wrap: balance;
  text-shadow: 0 2px 18px rgba(12, 5, 8, 0.6);
  transform-origin: left center;
  transition: color 450ms ease, transform 450ms var(--ease-out), text-shadow 450ms ease;
}

.stage-line.is-past {
  color: rgba(255, 243, 232, 0.66);
}

.stage-line.is-active {
  color: #fff6ee;
  text-shadow: 0 0 26px rgba(244, 194, 166, 0.42), 0 2px 18px rgba(12, 5, 8, 0.6);
  transform: scale(1.035);
}

/* Ordenador: con la letra activa, las fotos se colocan a la derecha y la letra ocupa la izquierda */
@media (min-width: 1000px) {
  body.lyrics-layout .photo-scene {
    padding-right: clamp(24px, 5vw, 80px);
    padding-left: 41vw;
  }

  body.lyrics-layout .photo-scene .photo-frame {
    grid-column: 1 / -1;
  }
}

/* Móvil y tableta: subtítulos de dos líneas encima del reproductor */
@media (max-width: 999px) {
  .lyrics-stage {
    top: auto;
    right: 0;
    bottom: calc(env(safe-area-inset-bottom) + var(--player-h, 77px) + 40px);
    left: 0;
    width: auto;
    padding: 44px 24px 12px;
    background: linear-gradient(to top, rgba(22, 9, 14, 0.9) 35%, rgba(22, 9, 14, 0));
    text-align: center;
    translate: none;
  }

  .lyrics-stage-song {
    margin-bottom: 6px;
    font-size: 17px;
  }

  .stage-line {
    margin-bottom: 0.25em;
    font-size: 27px;
    transform-origin: center;
  }
}

@media (max-width: 600px) {
  .lyrics-stage {
    bottom: calc(max(10px, env(safe-area-inset-bottom)) + var(--player-h, 77px) + 32px);
    padding: 40px 16px 10px;
  }

  .stage-line {
    font-size: 21px;
  }

  .stage-line.is-active {
    transform: scale(1.02);
  }
}

@media (prefers-reduced-motion: reduce) {
  .lyrics-stanza.is-in,
  .lyrics-stanza.is-out {
    animation-duration: 250ms;
    animation-name: none;
  }

  .lyrics-stanza.is-in {
    opacity: 1;
  }

  .stage-line.is-active {
    transform: none;
  }
}

/* ===== Pantalla de entrada: más grande (sobre todo en ordenador) ===== */
@media (min-width: 561px) {
  .sgf {
    margin-bottom: clamp(56px, 8vh, 110px);
    font-size: clamp(150px, min(21vw, 31vh), 340px);
  }

  .password-label {
    margin-bottom: 26px;
    font-size: clamp(48px, min(5.2vw, 7.5vh), 74px);
  }

  .date-fields {
    gap: clamp(8px, 1.3vw, 16px);
  }

  .group {
    gap: clamp(7px, 0.7vw, 10px);
  }

  .digit {
    width: clamp(54px, 6.1vw, 84px);
    height: clamp(66px, min(7.8vw, 11vh), 102px);
    font-size: clamp(28px, 3vw, 42px);
  }

  .digit::placeholder {
    font-size: 21px;
  }

  .slash {
    font-size: clamp(22px, 2.4vw, 32px);
  }
}

/* Botón de pista: que se vea claramente pulsable */
.hint-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 28px;
  padding: 15px 30px 14px;
  border: 1.5px solid rgba(239, 223, 189, 0.62);
  background: rgba(255, 241, 220, 0.08);
  box-shadow: 0 8px 26px rgba(10, 4, 6, 0.3);
  color: #efdfbd;
  font-size: clamp(24px, 2.2vw, 30px);
  transition:
    color 180ms ease,
    border-color 180ms ease,
    background-color 180ms ease,
    box-shadow 180ms ease,
    transform 150ms ease-out;
}

.hint-button span {
  margin-right: 0;
}

.hint-button:active {
  transform: scale(0.97);
}

.hint-button.is-used {
  border-color: rgba(239, 223, 189, 0.4);
}

@media (hover: hover) and (pointer: fine) {
  .hint-button:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 238, 214, 0.9);
    background: rgba(255, 241, 220, 0.14);
    box-shadow: 0 12px 30px rgba(10, 4, 6, 0.38), 0 0 22px rgba(231, 187, 151, 0.16);
  }
}

/* Texto de la pista: dos líneas, la segunda un momento después */
.hint-text {
  max-width: min(640px, 88vw);
  margin-top: 22px;
  text-align: center;
}

.hint-text p {
  margin: 0;
  color: rgba(234, 212, 192, 0.9);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(18px, 1.55vw, 22px);
  line-height: 1.5;
  letter-spacing: 0.01em;
  opacity: 0;
}

.hint-text.is-visible p {
  animation: quiet-in 900ms var(--ease-out) forwards;
}

.hint-text p.hint-text-late {
  margin-top: 8px;
  color: #efdfbd;
}

.hint-text.is-visible p.hint-text-late {
  animation-delay: 700ms;
}

@media (max-width: 560px) {
  .hint-button {
    margin-top: 22px;
    padding: 12px 22px 11px;
    font-size: 21px;
  }

  .hint-text p {
    font-size: 17px;
  }
}

/* ===== Texto del principio: segunda frase con un pequeño retraso ===== */
.phrase-late {
  display: block;
  margin-top: 0.35em;
  opacity: 0;
  transition: opacity 1000ms var(--ease-out) 1100ms;
}

.story-phrase.is-visible .phrase-late {
  opacity: 1;
}

.story-scene-long .story-phrase {
  max-width: 1100px;
  font-size: clamp(34px, 3.9vw, 58px);
  line-height: 1.3;
}

@media (max-width: 600px) {
  .story-scene-long .story-phrase {
    font-size: clamp(27px, 7.2vw, 36px);
  }
}

/* ===== Sección «solo la letra» ===== */
.lyrics-finale {
  position: relative;
  z-index: 1;
  display: grid;
  min-height: 100svh;
  grid-template-rows: auto 1fr auto;
  justify-items: center;
  padding: clamp(36px, 7vh, 72px) clamp(20px, 6vw, 90px) calc(var(--player-h, 77px) + 70px);
  background:
    radial-gradient(ellipse at 50% 45%, rgba(110, 45, 54, 0.22), transparent 60%),
    #120709;
}

.finale-song {
  margin: 0;
  color: rgba(224, 184, 173, 0.82);
  font-family: "Segoe Script", "Brush Script MT", cursive;
  font-size: clamp(20px, 1.8vw, 26px);
  text-align: center;
}

.finale-song::before {
  content: "♪ ";
  font-family: Georgia, "Times New Roman", serif;
}

.finale-stage {
  display: grid;
  width: min(1000px, 100%);
  align-self: center;
  justify-items: center;
}

.finale-stanza {
  grid-area: 1 / 1;
  text-align: center;
}

.lyrics-finale .stage-line {
  font-size: clamp(32px, 3.6vw, 58px);
  line-height: 1.22;
  transform-origin: center;
}

.finale-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.finale-play {
  min-height: 48px;
  padding: 0 24px;
  border: 1px solid rgba(239, 223, 189, 0.45);
  border-radius: 999px;
  background: rgba(255, 241, 220, 0.05);
  color: #efdfbd;
  font: 16px/1 Arial, sans-serif;
  letter-spacing: 0.04em;
  cursor: pointer;
  animation: quiet-in 600ms var(--ease-out) both;
}

.finale-count {
  margin: 0;
  color: rgba(234, 205, 188, 0.6);
  font: 15px/1.2 Arial, sans-serif;
  letter-spacing: 0.08em;
}

.finale-skip {
  position: absolute;
  bottom: calc(var(--player-h, 77px) + 32px);
  left: 50%;
  translate: -50% 0;
  padding: 8px 14px;
  color: rgba(225, 194, 167, 0.5);
  font-family: "Segoe Script", "Brush Script MT", cursive;
  font-size: 18px;
  text-decoration: none;
  transition: color 180ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .finale-skip:hover,
  .finale-play:hover {
    color: #f4e1d4;
  }
}

@media (max-width: 600px) {
  .lyrics-finale .stage-line {
    font-size: clamp(26px, 7vw, 34px);
  }
}

/* ===== Despedida ===== */
.story-farewell {
  background: #120709;
}

/* ===== Tarjetas con candado (fin) ===== */
.locked-section {
  position: relative;
  z-index: 1;
  padding: 8vh clamp(20px, 6vw, 90px) calc(var(--player-h, 77px) + 34vh);
  background: #120709;
}

.locked-cards {
  display: grid;
  max-width: 980px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(18px, 3vw, 36px);
  margin: 0 auto;
}

.locked-card {
  position: relative;
  display: flex;
  aspect-ratio: 4 / 5;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: clamp(20px, 2.4vw, 30px);
  border: 1px solid rgba(234, 205, 188, 0.22);
  border-radius: 16px;
  background:
    radial-gradient(circle at 30% 25%, rgba(190, 118, 130, 0.45), transparent 55%),
    radial-gradient(circle at 75% 70%, rgba(239, 187, 151, 0.28), transparent 50%),
    linear-gradient(145deg, #3a1a20, #1b0d11);
  box-shadow: 0 20px 50px rgba(5, 2, 3, 0.45);
  color: #f4e1d4;
  cursor: default;
  isolation: isolate;
}

/* Imagen pixelada de fondo (solo si existe) + velo burdeos para que se lea el texto */
.locked-card.has-image::before {
  content: "";
  position: absolute;
  z-index: -2;
  inset: 0;
  background: var(--card-image) center / cover no-repeat;
  image-rendering: pixelated;
}

.locked-card::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(180deg, rgba(24, 10, 15, 0.55), rgba(24, 10, 15, 0.15) 40%, rgba(24, 10, 15, 0.75));
}

.locked-card:not(.has-image)::after {
  backdrop-filter: blur(14px);
}

.locked-card-top {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(244, 225, 212, 0.88);
  font-family: "Segoe Script", "Brush Script MT", cursive;
  font-size: clamp(17px, 1.5vw, 21px);
}

.locked-lock {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
  transform-origin: 50% 20%;
}

.locked-title {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(28px, 2.8vw, 40px);
  font-weight: 400;
  line-height: 1.15;
  text-shadow: 0 2px 16px rgba(10, 4, 6, 0.6);
}

@media (hover: hover) and (pointer: fine) {
  .locked-card:hover .locked-lock {
    animation: lock-wiggle 600ms ease-in-out;
  }
}

@keyframes lock-wiggle {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-10deg); }
  55% { transform: rotate(8deg); }
  80% { transform: rotate(-4deg); }
}

@media (max-width: 640px) {
  .locked-cards {
    grid-template-columns: minmax(0, 1fr);
    max-width: 420px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .phrase-late {
    transition-delay: 300ms;
    transition-duration: 300ms;
  }

  .hint-text.is-visible p {
    animation-duration: 220ms;
  }

  .locked-card:hover .locked-lock {
    animation: none;
  }
}

.hint-button:not(.is-used) {
  animation: hint-glow 4200ms ease-in-out infinite;
}

@keyframes hint-glow {
  0%, 70%, 100% { box-shadow: 0 8px 26px rgba(10, 4, 6, 0.3); }
  82% { box-shadow: 0 8px 26px rgba(10, 4, 6, 0.3), 0 0 26px rgba(239, 200, 160, 0.28); }
}

@media (prefers-reduced-motion: reduce) {
  .hint-button:not(.is-used) {
    animation: none;
  }
}
