/* ============================================
   LUKA-SCAPE — Estilos compartidos
   ============================================ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #1a1230;
  font-family: 'Fredoka One', 'Arial Rounded MT Bold', Arial, sans-serif;
}

/* ── Pantalla completa con letterbox ── */
.screen {
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Contenedor del mapa (mantiene ratio 3:2) ── */
.map-wrapper {
  position: relative;
  /* Fit dentro del viewport manteniendo la proporción 1536×1024 */
  aspect-ratio: 1536 / 1024;
  max-width: 100vw;
  max-height: 100vh;
  /* Cuando el viewport es más ancho que 3:2 → limitado por altura */
  height: 100vh;
  width: calc(100vh * 1536 / 1024);
  /* Cuando el viewport es más estrecho que 3:2 → limitado por anchura */
}

@media (max-aspect-ratio: 1536/1024) {
  .map-wrapper {
    width: 100vw;
    height: calc(100vw * 1024 / 1536);
  }
}

.map-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill; /* rellena exactamente el wrapper */
  user-select: none;
  -webkit-user-drag: none;
}

/* ── Zonas clicables ── */
.hotspot {
  position: absolute;
  border-radius: 12px;
  cursor: pointer;
  text-decoration: none;
  /* Estado por defecto: casi invisible */
  background: transparent;
  border: 3px dashed transparent;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
  /* Necesario para que el tooltip se muestre sobre la imagen */
  z-index: 10;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow: visible;
}

/* Etiqueta flotante (visible en hover) */
.hotspot-label {
  position: absolute;
  top: -40px;
  left: 50%;
  transform: translateX(-50%) scale(0.7);
  transform-origin: bottom center;
  white-space: nowrap;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 1px;
  color: white;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  box-shadow: 0 3px 10px #0005;
  text-shadow: 0 1px 3px #0007;
}

.hotspot:hover .hotspot-label {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

/* Efecto hover según el lugar */
.hotspot:hover {
  transform: scale(1.03);
}

/* Pulso sutil para que los niños "vean" que son clicables */
@keyframes pulse-ring {
  0%   { box-shadow: 0 0 0 0 var(--hs-color, #FFD700aa); }
  70%  { box-shadow: 0 0 0 10px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.hotspot {
  animation: pulse-ring 2.8s ease-out infinite;
}

/* Cada hotspot tiene su propio color */
#hs-ikastola         { --hs-color: #FF6B35aa; }
#hs-johns-school     { --hs-color: #3366FFaa; }
#hs-bm-super         { --hs-color: #FF5500aa; }
#hs-kalistenia       { --hs-color: #2E8B22aa; }
#hs-yummy            { --hs-color: #FF1493aa; }
#hs-musika           { --hs-color: #7B2FA0aa; }
#hs-liburutegi       { --hs-color: #8B4513aa; }

#hs-ikastola .hotspot-label     { background: #FF6B35; }
#hs-johns-school .hotspot-label { background: #3366FF; }
#hs-bm-super .hotspot-label     { background: #FF5500; }
#hs-kalistenia .hotspot-label   { background: #2E8B22; }
#hs-yummy .hotspot-label        { background: #FF1493; }
#hs-musika .hotspot-label       { background: #7B2FA0; }
#hs-liburutegi .hotspot-label   { background: #8B4513; }

.hotspot:hover {
  background: color-mix(in srgb, var(--hs-color, #FFD700) 18%, transparent);
  border-color: color-mix(in srgb, var(--hs-color, #FFD700) 80%, transparent);
}

/* ── Páginas de lugar ── */
.lugar-screen {
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
  position: relative;
  overflow: hidden;
}

.lugar-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background: inherit;
  filter: brightness(0.88);
  z-index: 0;
}

.lugar-screen > * { position: relative; z-index: 1; }

.btn-volver {
  position: fixed;
  top: 28px;
  left: 28px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: white;
  color: #333;
  text-decoration: none;
  font-size: 18px;
  font-weight: 900;
  padding: 10px 22px 10px 16px;
  border-radius: 50px;
  box-shadow: 0 4px 16px #0003;
  transition: transform 0.15s, box-shadow 0.15s;
  z-index: 100;
}

.btn-volver:hover {
  transform: translateX(-4px);
  box-shadow: 0 6px 20px #0004;
}

.lugar-emoji {
  font-size: clamp(80px, 14vw, 160px);
  line-height: 1;
  margin-bottom: 24px;
  filter: drop-shadow(0 8px 20px #0004);
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-14px); }
}

.lugar-titulo {
  font-size: clamp(36px, 6vw, 90px);
  font-weight: 900;
  color: white;
  text-shadow: 0 4px 0 #0003, 0 0 40px #fff4;
  letter-spacing: 3px;
  margin-bottom: 16px;
}

.lugar-subtitulo {
  font-size: clamp(16px, 2.2vw, 28px);
  color: white;
  opacity: 0.92;
  max-width: 640px;
  margin: 0 auto 40px;
  line-height: 1.5;
  text-shadow: 0 2px 8px #0004;
}

.lugar-pronto {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: white;
  border-radius: 50px;
  padding: 14px 32px;
  font-size: clamp(16px, 2vw, 24px);
  font-weight: 900;
  color: #333;
  box-shadow: 0 6px 24px #0003;
  opacity: 0.9;
}
