/* ==========================================================================
   kota.css — peta isometrik, gedung, dan kendali geser/perbesar
   ========================================================================== */

.peta-bungkus {
  position: relative;
  border-radius: 18px;
  border: 1px solid var(--garis);
  background:
    radial-gradient(90% 70% at 50% 10%, rgba(14, 47, 69, .9), transparent 70%),
    linear-gradient(180deg, #061722, #030a11);
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(126, 240, 255, .08), 0 24px 60px rgba(0, 0, 0, .5);
}

.peta-bungkus::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(50% 40% at 50% 0%, rgba(126, 240, 255, .12), transparent 72%),
    radial-gradient(70% 60% at 50% 110%, rgba(79, 227, 208, .1), transparent 70%);
}

.peta {
  position: relative;
  width: 100%;
  height: clamp(420px, 68vh, 700px);
  cursor: grab;
  touch-action: none;
  overflow: hidden;
}
.peta.menyeret { cursor: grabbing; }

.peta-isi {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  transform-origin: center center;
  transition: transform .12s linear;
  will-change: transform;
}

.peta-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 20px 40px rgba(0, 0, 0, .55));
}

/* ---------- Petak dasar ---------- */
.petak polyline {
  fill: none;
  stroke: rgba(126, 240, 255, .16);
  stroke-width: 1.1;
}

/* Alas palung: tepi tipis bercahaya di sekeliling kota. */
.alas {
  stroke: rgba(126, 240, 255, .28);
  stroke-width: 1.4;
}

/* ---------- Jalan ---------- */
.jalan polyline {
  fill: none;
  stroke: rgba(79, 227, 208, .62);
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 7 11;
  animation: jalanMengalir 3.4s linear infinite;
  filter: drop-shadow(0 0 4px rgba(79, 227, 208, .7));
}

@keyframes jalanMengalir {
  to { stroke-dashoffset: -28; }
}

/* ---------- Gedung ---------- */
.gedung {
  cursor: pointer;
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: gedungNaik .8s var(--lengkung) both;
  animation-delay: calc(var(--urut, 0) * 55ms);
  transition: filter .25s ease, transform .35s var(--lengkung);
}

@keyframes gedungNaik {
  from { opacity: 0; transform: translateY(26px); }
  to   { opacity: 1; transform: none; }
}

.gedung:hover,
.gedung:focus-visible {
  filter: drop-shadow(0 0 14px rgba(126, 240, 255, .55));
  transform: translateY(-5px);
}

.muka-atap { stroke: rgba(255, 255, 255, .16); stroke-width: .5; }
.muka-selatan { stroke: rgba(0, 0, 0, .25); stroke-width: .4; }

.bayangan-gedung { filter: blur(2px); }

/* Jendela: gelap secara bawaan, sebagian menyala dan berkedip pelan. */
.jendela { fill: rgba(3, 12, 18, .62); }

.jendela.nyala {
  fill: var(--amber);
  animation: kedipJendela 5.5s ease-in-out infinite;
}

@keyframes kedipJendela {
  0%, 100% { opacity: .95; }
  46%      { opacity: .95; }
  50%      { opacity: .3; }
  54%      { opacity: .95; }
}

.mercusuar {
  fill: #fff8e6;
  animation: kedipMercusuar 2.6s ease-in-out infinite;
}

.mercusuar-halo {
  fill: rgba(255, 180, 87, .22);
  animation: kedipMercusuar 2.6s ease-in-out infinite;
}

@keyframes kedipMercusuar {
  0%, 100% { opacity: 1; }
  50%      { opacity: .18; }
}

.gelembung {
  fill: none;
  stroke: rgba(126, 240, 255, .45);
  stroke-width: .6;
  animation-name: gelembungNaik;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

@keyframes gelembungNaik {
  0%   { transform: translateY(0); opacity: 0; }
  15%  { opacity: .85; }
  80%  { opacity: .4; }
  100% { transform: translateY(-90px); opacity: 0; }
}

/* ---------- Kendali ---------- */
.peta-kendali {
  position: absolute;
  right: 14px;
  bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.peta-kendali button {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid var(--garis-kuat);
  background: rgba(6, 20, 32, .86);
  color: var(--tinta);
  font-size: 1.05rem;
  line-height: 1;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background .2s ease, transform .2s ease, border-color .2s ease;
}
.peta-kendali button:hover {
  background: rgba(79, 227, 208, .18);
  border-color: rgba(79, 227, 208, .5);
  transform: translateY(-1px);
}

.peta-petunjuk {
  position: absolute;
  left: 16px;
  bottom: 14px;
  margin: 0;
  font-size: .76rem;
  color: var(--samar);
  pointer-events: none;
}

/* ---------- Daftar gedung ---------- */
.gedung-daftar {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.gedung-kartu {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  text-align: left;
  border-radius: 11px;
  border: 1px solid var(--garis);
  background: linear-gradient(180deg, rgba(10, 34, 51, .6), rgba(6, 20, 32, .5));
  transition: transform .25s var(--lengkung), border-color .25s ease, background .25s ease;
}
.gedung-kartu:hover {
  transform: translateY(-3px);
  border-color: rgba(79, 227, 208, .42);
  background: linear-gradient(180deg, rgba(14, 47, 69, .8), rgba(6, 20, 32, .6));
}

.gedung-jenis {
  font-size: .64rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--biolum);
}

.gedung-kartu strong {
  font-family: var(--judul);
  font-size: 1rem;
  font-weight: 600;
}

.gedung-kartu em {
  font-style: normal;
  font-size: .8rem;
  color: var(--samar);
  line-height: 1.5;
}

@media (max-width: 640px) {
  .peta { height: clamp(360px, 58vh, 520px); }
  .peta-petunjuk { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .gedung { animation: none; }
  .jendela.nyala, .mercusuar, .mercusuar-halo, .jalan polyline, .gelembung { animation: none; }
}
