/* ══════════════════════════════════════════════════
   css/level_select_map.css  — PvZClassic
   Floating island level select — scales to screen height,
   scrolls horizontally. Works on mobile & desktop.
══════════════════════════════════════════════════ */

/* ── Screen container ─────────────────────────────── */
.lsm-container {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

/* ── Sky background (fixed, fills screen) ─────────── */
.lsm-sky {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #87ceeb 0%, #c9e8f5 60%, #e8f4fd 100%);
  z-index: 0;
}

/* ── Horizontal scroll wrapper ───────────────────── */
.lsm-scroll {
  position: absolute;
  inset: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  cursor: grab;
  -webkit-overflow-scrolling: touch;
  /* vertically centre the island */
  display: flex;
  align-items: center;
  z-index: 1;
}
.lsm-scroll::-webkit-scrollbar { display: none; }
.lsm-scroll:active { cursor: grabbing; }

/* ── Island wrapper ───────────────────────────────── */
/* Height fills the scroll container (minus small vertical padding).
   Width = height × aspect ratio — this is the key to keeping nodes
   at the correct % positions regardless of screen size.            */
.lsm-island {
  position: relative;
  flex-shrink: 0;
  height: 100%;
  aspect-ratio: 2.4 / 1;
  min-height: 260px;
  max-height: 600px;
}

/* ── Island image ─────────────────────────────────── */
.lsm-island-img {
  position: absolute;
  inset: 0;
  background-size: 100% 100%;   /* stretch to fill island div exactly */
  background-repeat: no-repeat;
  background-position: center;
  border-radius: 8px;
  /* Soft shadow so island floats above sky */
  filter: drop-shadow(0 12px 32px rgba(0,0,0,0.35));
}

/* ── SVG path layer ───────────────────────────────── */
.lsm-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
  /* stroke-width in viewBox units (0-100), so 1.2 = 1.2% of width */
}

/* ══════════════════════════════════════════════════
   LEVEL NODE
══════════════════════════════════════════════════ */
.lsm-node {
  position: absolute;
  /* Centre the node on its % coordinate */
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  z-index: 5;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}
.lsm-node.lsm-locked {
  cursor: default;
}

/* ── Slab circle ──────────────────────────────────── */
.lsm-slab {
  width: var(--slab-w, 28px);
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Unlocked: natural warm grey stone matching island slabs */
  background: radial-gradient(circle at 38% 28%,
    #d4cfc8 0%, #b0a99e 40%, #8c8278 72%, #6e6058 100%);
  border: 2px solid #5a5048;
  box-shadow:
    0 3px 0 #3e3830,
    0 5px 10px rgba(0,0,0,0.5),
    inset 0 1px 0 rgba(255,255,255,0.25);
  transition: transform 0.12s, box-shadow 0.12s;
}
.lsm-node:not(.lsm-locked):active .lsm-slab {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #3e3830, 0 2px 5px rgba(0,0,0,0.45);
}

/* Completed — slightly mossy stone (subtle green tint, still natural) */
.lsm-node.lsm-done .lsm-slab {
  background: radial-gradient(circle at 38% 28%,
    #c8d4be 0%, #9eb890 40%, #708c62 70%, #4e6644 100%);
  border-color: #4a6040;
  box-shadow:
    0 3px 0 #3a4e30,
    0 5px 10px rgba(0,0,0,0.45),
    inset 0 1px 0 rgba(255,255,255,0.2);
}

/* Current — warm cream/highlight stone, glowing edge only */
.lsm-node.lsm-current .lsm-slab {
  background: radial-gradient(circle at 38% 28%,
    #ede8d8 0%, #c8bfa0 40%, #a09070 70%, #7a6c50 100%);
  border-color: #d4b860;
  box-shadow:
    0 3px 0 #5a4820,
    0 5px 10px rgba(0,0,0,0.5),
    inset 0 1px 0 rgba(255,255,255,0.35),
    0 0 14px rgba(212,184,96,0.7),
    0 0 24px rgba(212,184,96,0.3);
  animation: lsm-glow 1.8s ease-in-out infinite;
}

/* Elite — darker, rougher stone with amber edge */
.lsm-node.lsm-elite:not(.lsm-done):not(.lsm-current) .lsm-slab {
  background: radial-gradient(circle at 38% 28%,
    #b8a888 0%, #8a7860 40%, #665848 70%, #4a3e30 100%);
  border-color: #c8a850;
  box-shadow:
    0 3px 0 #2e2418,
    0 5px 10px rgba(0,0,0,0.55),
    inset 0 1px 0 rgba(255,255,255,0.2),
    0 0 8px rgba(200,168,80,0.4);
}

/* Locked — dark slate with reddish-brown tint, clearly different from unlocked */
.lsm-node.lsm-locked .lsm-slab {
  background: radial-gradient(circle at 38% 28%,
    #7a6060 0%, #5c4040 45%, #3e2828 75%, #2a1818 100%);
  border-color: #6a3030;
  box-shadow:
    0 3px 0 #1a0c0c,
    0 5px 10px rgba(0,0,0,0.65),
    inset 0 1px 0 rgba(255,255,255,0.08);
}

.lsm-node.lsm-locked .lsm-num {
  color: #a08080;
  text-shadow: none;
}

@keyframes lsm-glow {
  0%, 100% { box-shadow:
    0 3px 0 #5a4820, 0 5px 10px rgba(0,0,0,0.5),
    inset 0 1px 0 rgba(255,255,255,0.35),
    0 0 14px rgba(212,184,96,0.7), 0 0 24px rgba(212,184,96,0.3); }
  50% { box-shadow:
    0 3px 0 #5a4820, 0 5px 10px rgba(0,0,0,0.5),
    inset 0 1px 0 rgba(255,255,255,0.35),
    0 0 22px rgba(212,184,96,1), 0 0 40px rgba(212,184,96,0.55); }
}

/* ── Number label ─────────────────────────────────── */
.lsm-num {
  font-family: var(--font-display, sans-serif);
  font-size: 14px;
  font-weight: 900;
  color: #fff;
  text-shadow:
    -1px -1px 0 rgba(0,0,0,0.7),
     1px -1px 0 rgba(0,0,0,0.7),
    -1px  1px 0 rgba(0,0,0,0.7),
     1px  1px 0 rgba(0,0,0,0.7),
     0 2px 4px rgba(0,0,0,0.9);
  pointer-events: none;
  line-height: 1;
}

/* ── Stars ────────────────────────────────────────── */
.lsm-stars {
  font-size: 5px;
  line-height: 1;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.9));
  letter-spacing: -1px;
  position: absolute;
  bottom: 2px;
}

/* ── Current arrow ────────────────────────────────── */
.lsm-arrow {
  font-size: 10px;
  color: #d4b860;
  animation: lsm-bounce 1s ease-in-out infinite;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.9));
}
@keyframes lsm-bounce {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(3px); }
}

/* ── Reward badge ─────────────────────────────────── */
.lsm-badge {
  font-size: 9px;
  background: rgba(0,0,0,0.75);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 5px;
  padding: 1px 3px;
  position: absolute;
  top: -16px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  pointer-events: none;
}

/* ══════════════════════════════════════════════════
   LEVEL SELECT HEADER
══════════════════════════════════════════════════ */
.levelselect-container {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.levelselect-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  height: 44px;
  flex-shrink: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255,255,255,0.12);
  z-index: 20;
}
.levelselect-header h2 {
  font-family: var(--font-display, sans-serif);
  font-size: 16px;
  color: #fff;
  margin: 0;
  flex: 1;
  text-align: center;
  letter-spacing: 2px;
  text-shadow: 0 2px 6px rgba(0,0,0,0.8);
}
