/* ============================================================
   map3d.css — el mapa de niveles: cielo de caramelo, nubes suaves,
   sendero de puntos y nodos redondos con estrellas.
   Sólo se usa en la vista 3D (la 2D no carga este archivo).
   ============================================================ */

.map-screen {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: #fff7ea;
  font: inherit;
  opacity: 0;
  transition: opacity .18s ease;
  background:
    radial-gradient(120% 60% at 50% 0%, rgba(255, 214, 122, .35), transparent 60%),
    radial-gradient(90% 45% at 50% 100%, rgba(255, 255, 255, .35), transparent 70%),
    linear-gradient(180deg, #21144a 0%, #5a2a86 26%, #a53f8e 52%, #ff86a8 76%, #ffd27a 100%);
}
.map-screen[hidden] { display: none; }
.map-screen.in { opacity: 1; }
body.map-open { overflow: hidden; }

/* --- nubes: manchas blancas difuminadas que se deslizan despacio --- */
.map-sky { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.map-cloud {
  position: absolute;
  left: -45%;
  width: 55%;
  height: 88px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 255, 255, .55), rgba(255, 255, 255, 0));
  filter: blur(7px);
  animation: map-drift 54s linear infinite;
}
@keyframes map-drift {
  from { transform: translateX(0); }
  to { transform: translateX(260%); }
}

/* --- cabecera --- */
.map-head {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) 14px 12px;
  background: linear-gradient(180deg, rgba(24, 10, 44, .82), rgba(24, 10, 44, 0));
}
.map-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: .2px;
  text-shadow: 0 2px 6px rgba(0, 0, 0, .45);
}
.map-title-ico { font-size: 19px; }
.map-count {
  margin-left: auto;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .18);
  border: 1px solid rgba(255, 255, 255, .22);
  white-space: nowrap;
}
.map-close {
  width: 34px; height: 34px;
  border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .18);
  color: #fff; font-size: 15px; line-height: 1;
  cursor: pointer;
}
.map-close:hover { background: rgba(255, 255, 255, .3); }

/* --- la zona que se desplaza --- */
.map-scroll {
  position: relative;
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .5) transparent;
  outline: none;
}
.map-scroll::-webkit-scrollbar { width: 8px; }
.map-scroll::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .45); border-radius: 999px; }

.map-road {
  position: relative;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
}
.map-path { position: absolute; inset: 0; pointer-events: none; }
.map-path .road-shadow {
  fill: none;
  stroke: rgba(74, 18, 58, .38);
  stroke-width: 26;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.map-path .road-line {
  fill: none;
  stroke: #ffe9c2;
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 2 18;
  opacity: .85;
}

/* --- un nodo --- */
.map-node {
  position: absolute;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 74px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.mn-bead {
  position: relative;
  width: 60px; height: 60px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 3px solid #fff3d6;
  background: linear-gradient(160deg, #ff8fb4 0%, #e2559d 45%, #9a3fc4 100%);
  box-shadow: 0 6px 0 rgba(78, 16, 58, .5), inset 0 -6px 12px rgba(0, 0, 0, .22),
    inset 0 5px 10px rgba(255, 255, 255, .35);
  transition: transform .12s ease;
}
.map-node:hover:not(.locked) .mn-bead { transform: translateY(-2px) scale(1.03); }
.map-node:active:not(.locked) .mn-bead { transform: translateY(2px) scale(.98); }
.mn-num {
  font-weight: 900;
  font-size: 22px;
  letter-spacing: -.5px;
  text-shadow: 0 2px 0 rgba(90, 20, 70, .55), 0 0 10px rgba(255, 255, 255, .35);
}
.mn-goal {
  position: absolute;
  right: -3px; bottom: -3px;
  width: 18px; height: 18px;
  display: grid;
  place-items: center;
  font-size: 10px;
  border-radius: 50%;
  background: rgba(255, 250, 240, .95);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .35);
}
.mn-lock {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  font-size: 21px;
  background: rgba(30, 22, 48, .55);
  border-radius: 50%;
}
.mn-stars { display: flex; gap: 2px; font-size: 11px; line-height: 1; }
.mn-stars i { color: rgba(255, 255, 255, .32); font-style: normal; }
.mn-stars i.on { color: #ffd83d; text-shadow: 0 0 7px rgba(255, 179, 0, .9); }

.map-node.locked { cursor: not-allowed; }
.map-node.locked .mn-bead {
  background: linear-gradient(160deg, #7d7694 0%, #544d6b 60%, #3b3550 100%);
  border-color: rgba(255, 255, 255, .3);
  box-shadow: 0 5px 0 rgba(40, 16, 40, .45);
}
.map-node.locked .mn-num { opacity: .55; text-shadow: none; }
.map-node.locked .mn-lock { display: grid; }
.map-node.locked .mn-goal { display: none; }

.map-node.done .mn-bead::after {
  content: '✓';
  position: absolute;
  top: -6px; left: -6px;
  width: 20px; height: 20px;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 800;
  color: #1f7a4a;
  background: #b6f7cf;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .35);
}

.map-node.now .mn-bead {
  border-color: #ffe066;
  animation: map-pulse 1.5s ease-in-out infinite;
}
@keyframes map-pulse {
  0%, 100% {
    box-shadow: 0 0 0 4px rgba(255, 214, 64, .30), 0 6px 0 rgba(78, 16, 58, .5),
      inset 0 -6px 12px rgba(0, 0, 0, .22);
  }
  50% {
    box-shadow: 0 0 0 12px rgba(255, 214, 64, .06), 0 6px 0 rgba(78, 16, 58, .5),
      inset 0 -6px 12px rgba(0, 0, 0, .22);
    transform: scale(1.06);
  }
}

/* --- cartel de mundo --- */
.map-world {
  position: absolute;
  left: 50%;
  transform: translate(-50%, 0);
  padding: 3px 13px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  white-space: nowrap;
  color: #fff6e4;
  background: rgba(58, 20, 74, .42);
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 999px;
  backdrop-filter: blur(4px);
  pointer-events: none;
}
.map-world.locked { opacity: .55; }

/* --- pie --- */
.map-foot {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px calc(12px + env(safe-area-inset-bottom));
  font-size: 12.5px;
  line-height: 1.35;
  background: linear-gradient(0deg, rgba(22, 9, 40, .88), rgba(22, 9, 40, 0));
}
.map-play {
  margin-left: auto;
  flex: 0 0 auto;
  padding: 10px 22px;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-weight: 800;
  color: #4a1400;
  background: linear-gradient(180deg, #ffe066, #ffa41b);
  box-shadow: 0 4px 0 #b96b00, 0 8px 18px rgba(0, 0, 0, .35);
  cursor: pointer;
}
.map-play:active { transform: translateY(2px); box-shadow: 0 2px 0 #b96b00; }

/* Botón del reto diario, en la cabecera del mapa. */
.map-daily {
  border: 0;
  border-radius: 999px;
  padding: 9px 16px;
  font: inherit;
  font-weight: 800;
  font-size: 14px;
  color: #fff;
  background: linear-gradient(180deg, #ff6ec7, #d92e8a);
  box-shadow: 0 3px 0 #8f1a5a, 0 6px 14px rgba(0, 0, 0, .3);
  cursor: pointer;
  white-space: nowrap;
}
.map-daily:disabled { opacity: .55; cursor: default; box-shadow: 0 3px 0 #6d4a5c; }
.map-daily:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 #8f1a5a; }

/* En pantallas muy bajas (móvil apaisado) el nodo se hace más pequeño. */
@media (max-height: 520px) {
  .map-head { padding-top: 6px; padding-bottom: 6px; }
  .mn-bead { width: 48px; height: 48px; }
  .mn-num { font-size: 18px; }
  .map-foot { padding-bottom: 8px; }
}
