:root {
  --color-fondo: #0f0f12;
  --color-superficie: #1a1a1f;
  --color-texto: #f2f0ec;
  --color-texto-tenue: #a8a5a0;
  --color-acento: #c9a15a;
  --radio: 14px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--color-fondo);
  color: var(--color-texto);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

img, video {
  max-width: 100%;
  display: block;
}

/* --- Login --- */

.login-screen {
  position: relative;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(120deg, #1a1210, #2b1810, #3d2410, #1a1210);
  background-size: 300% 300%;
  animation: atardecer 18s ease infinite;
  overflow: hidden;
}

.login-video-fondo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.login-capa-oscura {
  position: absolute;
  inset: 0;
  background: rgba(15, 10, 8, 0.55);
  z-index: 1;
}

.login-card {
  position: relative;
  z-index: 2;
}

.boton-musica-login {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 3;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(201, 161, 90, 0.6);
  background: rgba(26, 18, 16, 0.6);
  backdrop-filter: blur(4px);
  color: var(--color-acento);
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

.boton-musica-login:hover {
  background: rgba(26, 18, 16, 0.85);
}

@keyframes atardecer {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@media (prefers-reduced-motion: reduce) {
  .login-screen,
  .hero-frase {
    animation: none;
  }
}

.login-card {
  width: 100%;
  max-width: 340px;
  text-align: center;
}

.login-card h1 {
  font-family: "EB Garamond", Garamond, "Times New Roman", serif;
  font-size: 3.2rem;
  font-style: italic;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--color-acento);
  text-shadow: 0 2px 20px rgba(201, 161, 90, 0.35);
}

.login-subtitle {
  font-family: "EB Garamond", Garamond, "Times New Roman", serif;
  font-size: 1.4rem;
  color: #ffffff;
  margin-bottom: 8px;
}

.login-descripcion {
  color: var(--color-texto-tenue);
  font-size: 0.95rem;
  margin-bottom: 32px;
}

.efecto-escritura::after {
  content: "|";
  margin-left: 2px;
  animation: parpadeo-cursor 0.8s step-end infinite;
}

@keyframes parpadeo-cursor {
  50% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .efecto-escritura::after {
    animation: none;
  }
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-form input {
  padding: 14px 16px;
  border-radius: var(--radio);
  border: 1px solid #333;
  background: rgba(26, 26, 31, 0.6);
  backdrop-filter: blur(4px);
  color: var(--color-texto);
  font-size: 1rem;
  transition: border-color 0.2s ease;
}

.login-form input:focus {
  outline: none;
  border-color: var(--color-acento);
}

.login-form button {
  padding: 14px 16px;
  border-radius: var(--radio);
  border: none;
  background: var(--color-acento);
  color: #1a1300;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.login-form button:hover {
  background: #dab26e;
  box-shadow: 0 6px 20px rgba(201, 161, 90, 0.35);
  transform: translateY(-2px);
}

.login-form button:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(201, 161, 90, 0.3);
}

.login-error {
  margin-top: 16px;
  color: #e08585;
}

/* --- Portada --- */

.portada {
  padding-bottom: 48px;
}

.hero {
  position: relative;
  height: 78vh;
  min-height: 420px;
  max-height: 820px;
  background: linear-gradient(160deg, #26262c, #0f0f12);
  overflow: hidden;
}

.hero-foto {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero-capa {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  transform: translateY(-50%);
  padding: 0 20px 0 max(60px, 8vw);
  z-index: 2;
}

@media (max-width: 600px) {
  .hero-foto {
    object-position: 70% center;
  }

  .hero-capa {
    top: 72%;
    padding: 0 20px;
    text-align: center;
  }

  .hero-frase {
    text-align: center;
    max-width: none;
    margin: 0 auto;
  }
}

@keyframes hero-frase-entrada {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-frase {
  font-family: "EB Garamond", Garamond, "Times New Roman", serif;
  color: #fff;
  font-size: clamp(2.4rem, 9vw, 3.6rem);
  animation: hero-frase-entrada 1.1s ease-out both;
  font-weight: 600;
  font-style: italic;
  line-height: 1.15;
  text-align: left;
  margin: 0;
  max-width: 480px;
}

.hero-frase-secundaria {
  margin-top: 14px;
  font-size: clamp(1.6rem, 6vw, 2.2rem);
}

.portada-cabecera {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 24px 16px 16px;
}

.portada-cabecera h1 {
  color: var(--color-acento);
  margin-bottom: 4px;
}

.portada-cabecera p {
  font-family: "EB Garamond", Garamond, "Times New Roman", serif;
  color: #ffffff;
  margin: 0;
  font-size: 1rem;
}

.boton-nuevo-evento {
  flex-shrink: 0;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--color-acento);
  background: transparent;
  color: var(--color-acento);
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
}

.cuadricula-eventos {
  padding: 0 16px;
}

.cuadricula-eventos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.tarjeta-evento {
  border-radius: var(--radio);
  overflow: hidden;
  background: var(--color-superficie);
}

.tarjeta-evento-imagen {
  aspect-ratio: 1 / 1;
  background: #26262c;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.tarjeta-evento-imagen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.tarjeta-evento:hover .tarjeta-evento-imagen img,
.tarjeta-evento:active .tarjeta-evento-imagen img {
  transform: scale(1.08);
}

.tarjeta-evento-placeholder {
  font-size: 2rem;
  opacity: 0.5;
}

.tarjeta-evento-info {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tarjeta-evento-nombre {
  font-family: "EB Garamond", Garamond, "Times New Roman", serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: #ffffff;
}

.tarjeta-evento-contador {
  font-family: "EB Garamond", Garamond, "Times New Roman", serif;
  font-size: 0.85rem;
  color: #ffffff;
}

.portada-vacia {
  text-align: center;
  color: var(--color-texto-tenue);
  margin-top: 60px;
  padding: 0 16px;
}

/* --- Modal --- */

.modal-fondo {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 100;
}

.modal-fondo[hidden] {
  display: none;
}

.modal {
  width: 100%;
  max-width: 360px;
  background: var(--color-superficie);
  border-radius: var(--radio);
  padding: 20px;
}

.modal h2 {
  margin-top: 0;
  color: var(--color-acento);
}

.modal form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal input,
.modal textarea {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #333;
  background: var(--color-fondo);
  color: var(--color-texto);
  font-size: 1rem;
  font-family: inherit;
  resize: vertical;
}

.modal-botones {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 6px;
}

.boton-primario,
.boton-secundario {
  padding: 10px 16px;
  border-radius: 999px;
  border: none;
  font-weight: 600;
  font-size: 0.9rem;
}

.boton-primario {
  background: var(--color-acento);
  color: #1a1300;
}

.boton-secundario {
  background: transparent;
  color: var(--color-texto-tenue);
}

.lista-canciones {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  max-height: 300px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.lista-canciones-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--color-fondo);
}

.lista-canciones-nombre {
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lista-canciones-borrar {
  flex-shrink: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 1rem;
}

.lista-canciones-vacio {
  color: var(--color-texto-tenue);
  font-size: 0.9rem;
  text-align: center;
  padding: 12px 0;
}

/* --- Detalle de evento --- */

.detalle-evento {
  padding-bottom: 96px;
}

.detalle-cabecera {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  padding-right: 76px;
  position: sticky;
  top: 0;
  background: var(--color-fondo);
  z-index: 10;
}

.boton-volver {
  font-size: 1.4rem;
  padding: 4px 10px;
}

.boton-icono {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: var(--color-superficie);
  font-size: 0.95rem;
  cursor: pointer;
}

.detalle-cabecera h1 {
  font-size: 1.2rem;
  margin: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.boton-subir-momento {
  flex-shrink: 0;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--color-acento);
  color: var(--color-acento);
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.indicador-subida {
  text-align: center;
  color: var(--color-texto-tenue);
  padding: 8px 16px;
  font-size: 0.85rem;
}

.visor {
  position: relative;
}

.visor-carrusel {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.visor-slide {
  flex: 0 0 100%;
  scroll-snap-align: center;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #000;
}

.visor-slide img,
.visor-slide video {
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
}

.visor-nota {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px 16px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
  color: #fff;
  margin: 0;
  font-size: 0.9rem;
}

.visor-indicador {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 10px 0;
}

.visor-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #3a3a40;
}

.visor-dot.activo {
  background: var(--color-acento);
}

.cuadricula-miniaturas {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
}

.miniatura {
  aspect-ratio: 1 / 1;
  border: none;
  padding: 0;
  background: #26262c;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.miniatura img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.miniatura-video-icono {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.2rem;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

.miniatura-portada-icono {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  opacity: 0.55;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.miniatura-portada-icono:hover,
.miniatura-portada-icono--activo {
  opacity: 1;
  transform: scale(1.15);
}

.miniatura-borrar-icono {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  opacity: 0.55;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.miniatura-borrar-icono:hover {
  opacity: 1;
  transform: scale(1.15);
}

.detalle-vacio {
  text-align: center;
  color: var(--color-texto-tenue);
  margin-top: 60px;
}

/* --- Barra bocadillo de navegación --- */

.bocadillo-navegacion {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 30;
}

.bocadillo-toggle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(26, 26, 31, 0.85);
  color: var(--color-acento);
  font-size: 1.3rem;
  backdrop-filter: blur(6px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  cursor: pointer;
}

.bocadillo-panel {
  position: absolute;
  top: 54px;
  right: 0;
  min-width: 220px;
  background: rgba(26, 26, 31, 0.96);
  backdrop-filter: blur(8px);
  border-radius: var(--radio);
  padding: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.bocadillo-panel[hidden] {
  display: none;
}

/* Flecha del bocadillo apuntando al botón */
.bocadillo-panel::before {
  content: "";
  position: absolute;
  top: -6px;
  right: 14px;
  width: 12px;
  height: 12px;
  background: rgba(26, 26, 31, 0.96);
  transform: rotate(45deg);
}

.bocadillo-opcion {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--color-texto);
  font-size: 0.9rem;
  text-align: left;
  cursor: pointer;
  width: 100%;
}

.bocadillo-opcion:hover {
  background: rgba(255, 255, 255, 0.06);
}

.bocadillo-opcion-icono {
  font-size: 1.1rem;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}

.bocadillo-opcion-salir {
  color: #e08585;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: 4px;
  padding-top: 12px;
}

/* --- Errores --- */

.pagina-error {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--color-texto-tenue);
}
