/* =========================================
   ZARA TOUR — Estilos
   ========================================= */

   :root {
    --background: #EDE3C9;
    --background-alt: #E1D4AE;
    --ink: #2A2016;
    --text: #2A2016;
    --text-muted: rgba(42, 32, 22, 0.55);
    --divider: rgba(122, 31, 31, 0.25);
    --maroon: #7A1F1F;
    --gold: #A9832F;
  
    --font-display: 'Pirata One', serif;
    --font-body: 'EB Garamond', serif;
    --font-accent: 'Pirata One', serif;
    --font-accent-bold: 'EB Garamond', serif;
  
    --transition-speed: 500ms;
    --transition-ease: cubic-bezier(0.65, 0, 0.35, 1);
  
    --frame-space: clamp(2.4rem, 9vw, 4rem);
  }
  
  * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }
  
  /* =========================================
     BASE
     ========================================= */
  
  .fondo-pergamino {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100dvh; /* clave para que no quede blanco al ocultarse la barra del navegador */
    background-color: #d1b894;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -1;
    transform: translateZ(0);
    will-change: transform;
    background-image: url('/assets/fondo-celu.jpg'); /* imagen por defecto (móviles) */
  }
  
  @media (min-width: 768px) {
    .fondo-pergamino {
      background-image: url('assets/fondo-pc.jpg');
    }
  }
  
  html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    background-color: transparent;
    overscroll-behavior: none;
  }
  
  body,
  a,
  button {
    cursor: url("assets/cursor-hand.png") 6 3, default !important;
  }
  
  body {
    min-height: 100vh;
    color: var(--text);
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
  }
  
  body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: 0.035;
    z-index: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  }
  
  button {
    font-family: inherit;
    background: none;
    border: none;
    cursor: pointer;
    color: inherit;
  }
  
  a {
    color: inherit;
    text-decoration: none;
  }
  
  /* =========================================
     PANTALLAS
     ========================================= */
  
  .screen {
    position: fixed;
    inset: 0;
    height: 100vh;   /* fallback */
    height: 100dvh;  /* altura visible real en Safari mobile */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity var(--transition-speed) var(--transition-ease);
    z-index: 1;
  }
  
  .screen.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
  
  .screen::before {
    content: '';
    position: absolute;
    inset: clamp(0.15rem, 0.6vw, 0.4rem);
    border-style: solid;
    border-width: clamp(20px, 3.5vw, 40px);
    border-image-source: url("assets/marco-joyado-v2.png");
    border-image-slice: 70;
    border-image-repeat: round;
    pointer-events: none;
    z-index: 2;
  }
  
  /* =========================================
     ESTRELLAS — vagan por la pantalla y esquivan el cursor
     ========================================= */
  
  .star-roam {
    position: absolute;
    top: 0;
    left: 0;
    width: clamp(14px, 1.8vw, 30px);
    pointer-events: none;
    will-change: transform;
    z-index: 3;
    opacity: 0.85;
  }
  
  /* =========================================
     PANTALLA 1 — HOME
     ========================================= */
  
  .home-title {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    position: relative;
    z-index: 5;
    transition: opacity 250ms ease, transform 250ms ease;
  }
  
  .home-title:hover {
    opacity: 0.9;
    transform: scale(1.015);
  }
  
  .home-title:active {
    opacity: 0.45;
  }
  
  .title-img {
    display: block;
    width: clamp(300px, 55vw, 500px);
    max-width: 100%;
    height: auto;
  }
  
  @media (max-width: 480px) {
    .title-img {
      width: clamp(200px, 70vw, 220px);
    }
  }
  
  /* =========================================
     PANTALLA 2 — FECHAS
     ========================================= */
  
  #screen-fechas {
    justify-content: flex-start;
    align-items: center;
    padding: clamp(4rem, 10vh, 6rem) var(--frame-space) clamp(2rem, 6vh, 3rem);
  }
  
  @media (max-width: 480px) {
    #screen-fechas {
      padding-top: 3rem;
      padding-bottom: 3rem;
    }
  }
  
  .fechas-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: clamp(2.5rem, 8vh, 4.5rem);
    text-align: center;
    position: relative;
    z-index: 5;
  }
  
  .fechas-title {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    position: relative;
    z-index: 5;
    transition: opacity 250ms ease;
  }
  
  .fechas-title:hover {
    opacity: 0.6;
  }
  
  .fechas-title-img {
    display: block;
    width: clamp(180px, 40vw, 320px);
    max-width: 100%;
    height: auto;
  }
  
  .fechas-list {
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding-right: 0.4rem;
    position: relative;
    z-index: 5;
    scrollbar-width: thin;
    scrollbar-color: var(--maroon) transparent;
  }
  
  .fecha-item {
    display: flex;
    align-items: baseline;
    gap: clamp(0.9rem, 2.5vw, 1.6rem);
    padding: clamp(1.1rem, 3vh, 1.5rem) 0;
    border-bottom: 1px solid var(--divider);
  }
  
  .fecha-info {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.4rem 0.7rem;
  }
  
  .fecha-date {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: clamp(1.05rem, 2.2vw, 1.25rem);
  }
  
  .fecha-city {
    font-family: var(--font-body);
    font-size: clamp(0.95rem, 2vw, 1.1rem);
    letter-spacing: 0.02em;
  }
  
  .fecha-venue {
    font-family: var(--font-body);
    font-style: italic;
    color: var(--text-muted);
  }
  
  .fecha-tickets {
    font-family: var(--font-body);
    font-style: italic;
    color: var(--maroon);
  }
  
  .fecha-tickets:hover {
    opacity: 0.6;
  }
  
  @media (max-width: 480px) {
    .fecha-item {
      flex-direction: row;
      flex-wrap: nowrap;
      align-items: baseline;
      justify-content: space-between;
      gap: 0.6rem;
    }
  
    .fecha-info {
      flex-wrap: wrap;
      overflow: hidden;
      gap: 0.2rem 0.4rem;
    }
  
    .fecha-date {
      font-size: 0.8rem;
      flex-shrink: 0;
    }
  
    .fecha-city {
      font-size: 0.8rem;
      white-space: nowrap;
      flex-shrink: 0;
    }
  
    .fecha-venue {
      display: block;
      flex-basis: 100%;
      font-size: 0.75rem;
      margin-top: 0.1rem;
    }
  
    .fecha-tickets {
      margin-top: 0;
      font-size: 0.8rem;
      flex-shrink: 0;
    }
  }
  
  /* =========================================
     NAV / LINKS COMUNES
     ========================================= */
  
  .menu-link {
    font-family: var(--font-body);
    font-size: clamp(1rem, 2vw, 1.15rem);
    letter-spacing: 0.1em;
    font-style: italic;
  }
  
  .menu-link:hover {
    opacity: 0.6;
  }
  
  .back-link {
    font-family: var(--font-body);
    color: var(--maroon);
    font-style: italic;
    font-size: clamp(0.7rem, 2.5vw, 0.85rem);
    letter-spacing: 0.06em;
  }
  
  .back-link:hover {
    opacity: 1;
    color: var(--text);
  }
  
  .back-link--corner {
    position: absolute;
    bottom: clamp(1.5rem, 4vh, 2.2rem);
    left: clamp(2.5rem, 4vw, 4rem);
  }
  
  .social-link--corner {
    position: absolute;
    bottom: clamp(1.5rem, 4vh, 2.2rem);
    right: clamp(2.5rem, 4vw, 4rem);
  }
  
  @media (max-width: 480px) {
    .menu-link,
    .fecha-tickets,
    .back-link {
      padding: 0.5rem;
    }
  }
  
  /* =========================================
     ELEMENTOS FLOTANTES (.floaty)
     ========================================= */
  
  .floaty {
    position: absolute;
    color: var(--gold);
    font-size: 1.6rem;
    opacity: 0.55;
    pointer-events: none;
    z-index: 3;
    animation-timing-function: ease-in-out;
    animation-iteration-count: infinite;
    animation-name: drift;
    animation-duration: 9s;
  }
  
  .floaty--1 { top: 20%; left: 15%; font-size: 1.8rem; animation-duration: 8s;  animation-delay: 0s; }
  .floaty--3 { top: 72%; left: 20%; font-size: 1.4rem; animation-duration: 11s; animation-delay: 2.5s; }
  .floaty--4 { top: 68%; left: 78%; font-size: 1.9rem; animation-duration: 9s;  animation-delay: 0.8s; }
  .floaty--5 { top: 10%; left: 50%; font-size: 1.2rem; animation-duration: 12s; animation-delay: 3.5s; }
  
  .floaty--drift  { animation-name: drift; }
  .floaty--sway   { animation-name: sway; }
  .floaty--bob    { animation-name: bob; }
  .floaty--wobble { animation-name: wobble; }
  .floaty--orbit  { animation-name: orbit; }
  
  @media (max-width: 480px) {
    .floaty {
      font-size: 1.1rem;
      opacity: 0.4;
    }
  }
  
  /* Imágenes flotantes (nubes, reloj, chancho, luna...) */
  .floaty-img {
    width: clamp(90px, 18vw, 180px);
    height: auto;
    opacity: 0.85;
  }
  
  /* Posiciones — Home */
  .floaty-img--7  { top: 35.8%; left: 76.6%; width: clamp(95px, 12.3vw, 258px); height: auto; }
  .floaty-img--8  { top: 65.3%; left: 75%;   width: clamp(46px, 6vw, 126px);    height: auto; }
  .floaty-img--9  { top: 18.6%; left: 15.2%; width: clamp(80px, 10.4vw, 218px); height: auto; }
  .floaty-img--10 { top: 61.8%; left: 19.8%; width: clamp(106px, 13.8vw, 290px); height: auto; }
  .floaty-img--12 { top: 76.1%; left: 49.3%; width: clamp(112px, 14.6vw, 306px); height: auto; }
  .floaty-img--14 { top: 16.7%; left: 53%;   width: clamp(96px, 12.5vw, 263px);  height: auto; }
  
  /* Posiciones — Fechas (solo PC) */
  .floaty-img.fechas-floaty--1 { top: 35.8%; left: 76.6%; width: clamp(95px, 12.3vw, 258px);  height: auto; }
  .floaty-img.fechas-floaty--2 { top: 65.3%; left: 75%;   width: clamp(46px, 6vw, 126px);     height: auto; }
  .floaty-img.fechas-floaty--3 { top: 18.6%; left: 15.2%; width: clamp(80px, 10.4vw, 218px);  height: auto; }
  .floaty-img.fechas-floaty--4 { top: 59.9%; left: 10.9%; width: clamp(74px, 9.6vw, 201px);   height: auto; }
  .floaty-img.fechas-floaty--5 { top: 42.4%; left: 12.1%; width: clamp(14px, 1.9vw, 150px);   height: auto; }
  .floaty-img.fechas-floaty--6 { top: 10%;   left: 67.1%; width: clamp(66px, 8.6vw, 180px);   height: auto; }
  
  @media (max-width: 480px) {
    .floaty-pc-only {
      display: none;
    }
  }
  
  /* =========================================
     ELEMENTOS ARRASTRABLES
     ========================================= */
  
  .floaty-draggable {
    pointer-events: auto;
    touch-action: none;
    cursor: url("assets/cursor-hand.png") 6 3, default !important;
    -webkit-user-drag: none;
    user-select: none;
    -webkit-user-select: none;
    z-index: 5;
  }
  
  .floaty-draggable.is-dragging {
    cursor: url("assets/cursor-hand.png") 6 3, default !important;
    animation: none !important; /* corta la animación (no la pausa) para que no quede un transform a mitad de camino */
    z-index: 10;
  }
  
  /* =========================================
     KEYFRAMES — variantes de movimiento
     ========================================= */
  
  @keyframes drift {
    0%   { transform: translate(0, 0) rotate(0deg); }
    25%  { transform: translate(6px, -10px) rotate(8deg); }
    50%  { transform: translate(-4px, 6px) rotate(-6deg); }
    75%  { transform: translate(-8px, -6px) rotate(4deg); }
    100% { transform: translate(0, 0) rotate(0deg); }
  }
  
  @keyframes sway {
    0%, 100% { transform: translateX(0) rotate(0deg); }
    50%      { transform: translateX(50px) rotate(2deg); }
  }
  
  @keyframes bob {
    0%, 100% { transform: translateY(0) scale(1); }
    50%      { transform: translateY(-12px) scale(1.04); }
  }
  
  @keyframes wobble {
    0%, 100% { transform: rotate(-6deg); }
    50%      { transform: rotate(7deg); }
  }
  
  @keyframes orbit {
    0%   { transform: translate(0, 0); }
    25%  { transform: translate(10px, 4px); }
    50%  { transform: translate(2px, -10px); }
    75%  { transform: translate(-10px, -2px); }
    100% { transform: translate(0, 0); }
  }