:root{
  --saffron: #FF9933;
  --green: #138808;
  --hairline: rgba(0,0,0,0.14);
  --ui-shadow: 0 10px 30px rgba(0,0,0,0.22);
  --ui-shadow-soft: 0 8px 18px rgba(0,0,0,0.18);

  --font-news: "Old Standard TT", serif;
  --font-hi: "Noto Sans Devanagari", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

html, body {
  height: 100%;
  width: 100%;
  margin: 0;
  background: #111;
}

#map{
  position: fixed;
  inset: 0;
  height: 100%;
  width: 100%;
  outline: none;
}

.ui{
  position: fixed;
  z-index: 9999;
  user-select: none;
  -webkit-user-select: none;
}

/* Title: 1950s headline vibe (no background box, but legible) */
#title-wrap{
  left: 18px;
  top: 14px;
  max-width: min(560px, calc(100vw - 36px));
  pointer-events: none;
}

#title{
  font-family: var(--font-news);
  font-weight: 700;
  letter-spacing: 0.6px;
  line-height: 1.02;
  font-size: clamp(28px, 3.4vw, 46px);
  color: rgba(255,255,255,0.92);
  text-shadow:
    0 2px 0 rgba(0,0,0,0.35),
    0 10px 25px rgba(0,0,0,0.55);
  filter: drop-shadow(0 14px 20px rgba(0,0,0,0.35));
}

#subtitle{
  margin-top: 6px;
  font-family: var(--font-news);
  font-size: 13px;
  letter-spacing: 0.4px;
  color: rgba(255,255,255,0.78);
  text-shadow: 0 8px 16px rgba(0,0,0,0.55);
}

/* Upper-right controls */
#controls{
  right: 14px;
  top: 14px;
  display: flex;
  gap: 10px;
  align-items: center;
}

.pill{
  font-family: var(--font-hi);
  font-weight: 700;
  font-size: 13px;
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.92);
  box-shadow: var(--ui-shadow-soft);
  backdrop-filter: blur(6px);
  cursor: pointer;
}
.pill:hover{ transform: translateY(-1px); }
.pill:active{ transform: translateY(0px); }

/* Burger */
#burger{
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--hairline);
  background: rgba(255,255,255,0.12);
  box-shadow: var(--ui-shadow-soft);
  backdrop-filter: blur(6px);
  cursor: pointer;
  position: relative;
}
#burger .burger-lines{
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 12px;
  transform: translate(-50%,-50%);
  background:
    linear-gradient(rgba(255,255,255,0.92), rgba(255,255,255,0.92)) 0 0/100% 2px no-repeat,
    linear-gradient(rgba(255,255,255,0.92), rgba(255,255,255,0.92)) 0 50%/100% 2px no-repeat,
    linear-gradient(rgba(255,255,255,0.92), rgba(255,255,255,0.92)) 0 100%/100% 2px no-repeat;
}

/* Menu */
#menu{
  position: absolute;
  right: 0;
  top: 54px;
  min-width: 170px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(15, 15, 15, 0.62);
  box-shadow: var(--ui-shadow);
  backdrop-filter: blur(10px);
  padding: 8px;
  display: none;
}
#menu button{
  width: 100%;
  padding: 10px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.92);
  font-family: var(--font-hi);
  font-weight: 700;
  cursor: pointer;
}
#menu button:hover{ background: rgba(255,255,255,0.12); }

/* Legend (minimizable) */
#legend{
  left: 14px;
  bottom: 14px;
  width: min(320px, calc(100vw - 28px));
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(15, 15, 15, 0.56);
  box-shadow: var(--ui-shadow);
  backdrop-filter: blur(10px);
  overflow: hidden;
}
#legendToggle{
  width: 100%;
  padding: 10px 12px;
  border: 0;
  background: transparent;
  color: rgba(255,255,255,0.92);
  font-family: var(--font-news);
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}
#legendBody{
  padding: 10px 12px 12px 12px;
  border-top: 1px solid rgba(255,255,255,0.12);
}
.legend-row{
  display: flex;
  gap: 10px;
  align-items: center;
  font-family: var(--font-hi);
  color: rgba(255,255,255,0.86);
  font-size: 13px;
}
.legend-swatch{
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: var(--saffron);
  box-shadow: 0 0 0 2px rgba(0,0,0,0.15), 0 4px 10px rgba(19,136,8,0.35);
}

/* Modal */
#modalBackdrop{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.52);
  z-index: 10000;
  display: none;
}
#modal{
  position: absolute;
  right: 14px;
  top: 70px;
  width: min(520px, calc(100vw - 28px));
  max-height: min(76vh, 720px);
  overflow: auto;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(18, 18, 18, 0.90);
  box-shadow: 0 22px 60px rgba(0,0,0,0.55);
  backdrop-filter: blur(10px);
}
#modalContent{
  padding: 16px 16px 18px 16px;
  color: rgba(255,255,255,0.92);
  font-family: var(--font-hi);
  font-size: 13px;
  line-height: 1.45;
}
#modalContent h2{
  margin: 0 0 8px 0;
  font-family: var(--font-news);
}

/* Leaflet popup restyle */
.leaflet-popup-content-wrapper{
  border-radius: 16px;
  background: rgba(18, 18, 18, 0.92);
  color: rgba(255,255,255,0.92);
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: 0 18px 60px rgba(0,0,0,0.55);
  backdrop-filter: blur(10px);
}
.leaflet-popup-tip{
  background: rgba(18, 18, 18, 0.92);
  border: 1px solid rgba(255,255,255,0.12);
}
.popup-title{
  font-family: var(--font-news);
  font-weight: 700;
  font-size: 16px;
  margin: 0 0 6px 0;
}
.popup-date{
  font-family: var(--font-news);
  font-size: 12px;
  opacity: 0.78;
  margin: 0 0 8px 0;
}
.popup-section{ margin: 10px 0 0 0; }
.popup-label{
  font-family: var(--font-hi);
  font-weight: 800;
  font-size: 12px;
  color: rgba(255,255,255,0.86);
  margin-bottom: 4px;
}
.popup-text{
  font-family: var(--font-hi);
  font-size: 13px;
  color: rgba(255,255,255,0.88);
}
.popup-sources ul{
  margin: 6px 0 0 18px;
  padding: 0;
}
.popup-sources li{ margin: 3px 0; }

/* India-vibe mask wash (above basemap, below points) */
.tricolor-mask{
  mix-blend-mode: multiply;
  opacity: 0.22;
  pointer-events: none;
}

/* Points: saffron fill, green drop shadow */
.gandhi-stop-marker{
  filter:
    drop-shadow(2px 3px 0 rgba(19,136,8,0.55))
    drop-shadow(0 10px 20px rgba(0,0,0,0.35));
}

/* Loading */
#loading{
  left: 50%;
  top: 50%;
  transform: translate(-50%,-50%);
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(15, 15, 15, 0.56);
  box-shadow: var(--ui-shadow);
  backdrop-filter: blur(10px);
  color: rgba(255,255,255,0.92);
  font-family: var(--font-hi);
}
.spinner{
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.25);
  border-top-color: rgba(255,255,255,0.92);
  animation: spin 0.9s linear infinite;
}
@keyframes spin{ to { transform: rotate(360deg); } }

@media (max-width: 480px){
  #subtitle{ display: none; }
  #legend{ width: min(280px, calc(100vw - 28px)); }
}
