/* Self-hosted, subset fonts (SIL OFL). Anek Devanagari by Ek Type, Figtree by Erik Kennedy. */
@font-face { font-family: "Anek Hi"; src: url(fonts/anek-hi.woff2) format("woff2"); font-weight: 800; font-display: swap; unicode-range: U+0900-097F, U+200C-200D, U+25CC; }
@font-face { font-family: "Anek"; src: url(fonts/anek-display.woff2) format("woff2"); font-weight: 600 800; font-display: swap; }
@font-face { font-family: "Figtree"; src: url(fonts/figtree.woff2) format("woff2"); font-weight: 400 700; font-display: swap; }

:root {
  --saffron: #FF9933;
  --saffron-deep: #E8750A;
  --green: #138808;
  --navy: #000080;
  --bg: #FBF7F0;
  --surface: #FFFFFF;
  --surface-2: #F6F0E6;
  --text: #1A1A1A;
  --muted: #6B6459;
  --border: #ECE3D4;
  --sea: #DCEAF2;
  --land: #FFFDF8;
  --land-line: #C9BBA3;
  --shade-1: #FFE9D1;
  --shade-2: #FFD3A3;
  --shade-3: #FFB766;
  --shade-4: #FF9933;
  --heading: #0B1F66;
  --shadow: 0 1px 2px rgba(40, 30, 10, .06), 0 8px 24px rgba(40, 30, 10, .08);
  --radius: 20px;
  --font: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Devanagari", sans-serif;
  --font-display: "Anek", "Figtree", system-ui, sans-serif;
  --font-hi: "Anek Hi", "Kohinoor Devanagari", "Noto Sans Devanagari", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0F0E0C;
    --surface: #1A1815;
    --surface-2: #24211C;
    --text: #F4EFE7;
    --muted: #ADA597;
    --border: #2F2B25;
    --sea: #0C1822;
    --land: #26221D;
    --land-line: #4A4338;
    --shade-1: #4A3215;
    --shade-2: #6E4512;
    --shade-3: #A25E0E;
    --shade-4: #E07A0E;
    --heading: #C9D4FF;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2 { font-family: var(--font-display); font-weight: 800; color: var(--heading); line-height: 1.1; letter-spacing: -.005em; }
a { color: var(--green); }

.tricolour-bar { display: grid; grid-template-rows: repeat(3, 4px); }
.tricolour-bar span:nth-child(1) { background: var(--saffron); }
.tricolour-bar span:nth-child(2) { background: #fff; }
.tricolour-bar span:nth-child(3) { background: var(--green); }

/* ---------- March strip ---------- */
.march-strip {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px 12px;
  padding: 9px 16px; background: #0B1F66; color: #fff; text-decoration: none; text-align: center;
  font-size: 14px; line-height: 1.35;
}
.march-strip b { font-family: var(--font-display); font-weight: 700; font-size: 15px; letter-spacing: .01em; }
.strip-cd { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; background: rgba(255,255,255,.14); font-weight: 600; font-variant-numeric: tabular-nums; }
.strip-cd:empty { display: none; }
.march-strip.done { display: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 15px/1 var(--font); padding: 12px 18px; min-height: 44px; border-radius: 999px;
  border: 1px solid transparent; cursor: pointer; text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.97); }
.btn:focus-visible, .chip:focus-visible, .icon-btn:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--saffron) 55%, transparent); outline-offset: 2px;
}
.btn-primary {
  background: linear-gradient(180deg, #FFA94D, var(--saffron-deep));
  color: #fff; box-shadow: 0 6px 18px rgba(232, 117, 10, .35);
}
.btn-primary:hover { box-shadow: 0 8px 24px rgba(232, 117, 10, .45); }
.btn-primary:disabled { opacity: .65; cursor: progress; }
.btn-outline { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-outline:hover { border-color: var(--saffron); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-wa { background: #25D366; color: #06371a; }
.btn-lg { font: 700 18px/1 var(--font-display); padding: 15px 26px; min-height: 52px; letter-spacing: .01em; }
.btn-block { width: 100%; }
.link-btn { background: none; border: 0; color: var(--green); font: 500 14px var(--font); cursor: pointer; padding: 4px 0; justify-self: start; }
.icon-btn { background: var(--surface-2); border: 0; width: 40px; height: 40px; border-radius: 50%; cursor: pointer; color: var(--text); font-size: 15px; }

/* ---------- Hero ---------- */
.hero { text-align: center; padding: 28px 16px 22px; max-width: 760px; margin: 0 auto; }
.eyebrow {
  display: inline-block; margin: 0 0 12px; padding: 5px 12px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border);
  font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
}
.hero h1 { margin: 0; display: grid; gap: 2px; }
.hero h1 .hi { font-family: var(--font-hi); font-size: clamp(2.6rem, 10vw, 4.2rem); font-weight: 800; line-height: 1.15; padding-top: .08em;
  background: linear-gradient(90deg, var(--saffron-deep), var(--saffron) 35%, var(--heading) 50%, var(--green) 70%);
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero h1 .en { font-size: clamp(1.1rem, 3.8vw, 1.4rem); font-weight: 700; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.tagline { margin: 10px auto 20px; max-width: 500px; color: var(--muted); font-size: 1.08rem; }

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; max-width: 420px; margin: 18px auto 0; }
.stat {
  padding: 10px 8px; border-radius: 16px; background: var(--surface);
  border: 1px solid var(--border); box-shadow: var(--shadow);
}
.stat strong { display: block; font: 800 1.8rem/1.1 var(--font-display); font-variant-numeric: tabular-nums; color: var(--saffron-deep); }
.stat:nth-child(2) strong { color: var(--heading); }
.stat:nth-child(3) strong { color: var(--green); }
.stat span { font-size: 13px; color: var(--muted); }
.hero-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }

/* ---------- Layout ---------- */
main { max-width: 1160px; margin: 0 auto; padding: 0 16px 16px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.map-card { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow); background: var(--sea); }
#map { height: min(72vh, 720px); min-height: 440px; background: var(--sea); }
@media (max-width: 599px) { #map { height: 480px; min-height: 0; } }
.map-legend {
  position: absolute; left: 12px; bottom: 12px; z-index: 500; display: flex; gap: 12px; flex-wrap: wrap;
  padding: 7px 12px; border-radius: 12px; background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(6px); font-size: 12px; color: var(--muted); border: 1px solid var(--border);
}
.map-legend span { display: inline-flex; align-items: center; gap: 6px; }
@media (max-width: 599px) { .map-legend { bottom: 26px; left: 10px; } }
.lg-flag { width: 14px; height: 10px; background: linear-gradient(var(--saffron) 33%, #fff 33% 66%, var(--green) 66%); border-radius: 1px; box-shadow: 0 0 0 .5px rgba(0,0,0,.2); }
.lg-ghost { width: 10px; height: 10px; border: 1.5px dashed var(--muted); border-radius: 50%; }

.grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
@media (min-width: 860px) {
  main, .grid { gap: 20px; }
  .grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
  .card { padding: 28px; }
}

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 20px; box-shadow: var(--shadow); }
.card h2 { margin: 0 0 12px; font-size: 1.65rem; }
.card-kicker { margin: 0 0 4px; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--saffron-deep); }
.recent .card-kicker::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #E53935; margin-right: 6px; vertical-align: 1px; animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.march p { margin: 0 0 12px; }
.march-actions { margin: 4px 0 14px; }
.sources { font-size: 13px; color: var(--muted); margin: 0; }

.countdown { display: flex; gap: 8px; margin: 0 0 16px; }
.countdown .cd { flex: 1; text-align: center; padding: 10px 4px; border-radius: 14px; background: var(--surface-2); }
.countdown .cd b { display: block; font: 800 1.8rem/1 var(--font-display); font-variant-numeric: tabular-nums; color: var(--heading); }
.countdown .cd small { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.countdown .cd-msg { flex: 1; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); font-weight: 600; }

.feed { list-style: none; margin: 0 -10px; padding: 0; display: grid; gap: 2px; max-height: 420px; overflow: auto; }
.feed li { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; padding: 10px; border-radius: 12px; cursor: pointer; }
.feed li:hover { background: var(--surface-2); }
.feed li.new { animation: flash 1.6s ease-out; }
@keyframes flash { from { background: color-mix(in srgb, var(--saffron) 25%, transparent); } }
.feed .av { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font: 700 15px var(--font-display); color: #fff; }
.feed .who { font-weight: 700; overflow-wrap: anywhere; }
.feed .where { color: var(--muted); font-size: 13px; }
.feed .msg { margin-top: 2px; overflow-wrap: anywhere; }
.feed .empty { cursor: default; display: block; color: var(--muted); padding: 10px; }

/* ---------- Content sections ---------- */
.card p { margin: 0 0 12px; }
.card p:last-child { margin-bottom: 0; }
.steps { margin: 0 0 18px; padding: 0; list-style: none; counter-reset: step; display: grid; gap: 12px; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; align-items: start; }
.steps li::before {
  content: counter(step); width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: color-mix(in srgb, var(--saffron) 18%, var(--surface)); color: var(--saffron-deep); font: 800 17px/1 var(--font-display);
}
@media (min-width: 860px) { .how .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.ticks { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.ticks li { padding-left: 28px; position: relative; }
.ticks li::before { content: "✓"; position: absolute; left: 0; top: 1px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--green) 15%, var(--surface)); color: var(--green); font-size: 12px; font-weight: 700; }
.faq details { border-top: 1px solid var(--border); }
.faq details:last-of-type { border-bottom: 1px solid var(--border); }
.faq summary { cursor: pointer; list-style: none; padding: 14px 32px 14px 0; font-weight: 700; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 50%; translate: 0 -50%; font: 600 22px/1 var(--font); color: var(--muted); transition: rotate .2s ease; }
.faq details[open] summary::after { rotate: 45deg; }
.faq details p { margin: 0 0 14px; color: var(--muted); }
.hindi .hi-h { font-family: "Kohinoor Devanagari", "Noto Sans Devanagari", var(--font); font-weight: 700; line-height: 1.35; }
.hindi { line-height: 1.7; }

footer { text-align: center; padding: 28px 16px 110px; color: var(--muted); font-size: 13px; }
@media (min-width: 860px) { footer { padding-bottom: 48px; } }
footer p { margin: 4px 0; }

/* Floating button (mobile, after scrolling past hero) */
.fab {
  position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 900;
  transform: translate(-50%, 140%); transition: transform .25s ease; padding: 15px 24px; font-size: 16px;
}
.fab.show { transform: translate(-50%, 0); }
@media (min-width: 860px) { .fab { left: auto; right: 24px; transform: translateY(140%); } .fab.show { transform: none; } }

/* ---------- Raise sheet ---------- */
dialog { border: 0; padding: 0; color: var(--text); background: transparent; max-width: none; max-height: none; }
dialog::backdrop { background: rgba(10, 8, 5, .55); backdrop-filter: blur(3px); }
.sheet form {
  width: min(480px, 100vw); max-height: 92dvh; overflow: auto;
  background: var(--surface); border-radius: 24px; padding: 20px; display: grid; gap: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.sheet[open] form { animation: pop .22s ease-out; }
@keyframes pop { from { transform: translateY(12px) scale(.98); opacity: 0; } }
@media (max-width: 599px) {
  .sheet { margin: auto 0 0; width: 100%; }
  .sheet form { width: 100%; border-radius: 24px 24px 0 0; padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
  .sheet[open] form { animation: slideup .25s ease-out; }
  @keyframes slideup { from { transform: translateY(100%); } }
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; }
.sheet-head h2 { margin: 0; font-size: 1.7rem; }
.field { display: grid; gap: 8px; }
.field label { font-weight: 700; font-size: 15px; display: flex; justify-content: space-between; align-items: baseline; }
.field label small { font-weight: 400; color: var(--muted); }
input, textarea {
  font: 16px var(--font); padding: 13px 14px; border-radius: 14px; width: 100%;
  border: 1px solid var(--border); background: var(--bg); color: var(--text);
}
textarea { resize: none; }
.combo { position: relative; }
.combo-ok { position: absolute; right: 12px; top: 50%; translate: 0 -50%; width: 24px; height: 24px; border-radius: 50%; display: none; place-items: center; background: var(--green); color: #fff; font-size: 13px; font-weight: 700; }
.combo.is-set .combo-ok { display: grid; }
.combo.is-set input { border-color: var(--green); padding-right: 44px; }
.locate-btn {
  justify-self: start; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 8px 14px;
  border-radius: 999px; border: 1px solid color-mix(in srgb, var(--green) 40%, var(--border)); background: color-mix(in srgb, var(--green) 7%, var(--surface));
  color: var(--green); font: 600 14px var(--font); cursor: pointer;
}
.locate-btn:hover { border-color: var(--green); }
#city-options {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 5; margin: 0; padding: 6px; list-style: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); max-height: 240px; overflow: auto;
}
#city-options li { padding: 10px 12px; border-radius: 10px; cursor: pointer; display: flex; justify-content: space-between; gap: 8px; }
#city-options li small { color: var(--muted); }
#city-options li[aria-selected="true"], #city-options li:hover { background: var(--surface-2); }
.chips-label { margin: 2px 0 -2px; font-size: 13px; color: var(--muted); }
@media (max-width: 599px) { .chips-label::after { content: " (swipe for more)"; } }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { font: 500 14px/1.25 var(--font); padding: 9px 14px; min-height: 40px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); cursor: pointer; text-align: left; }
.chip:hover { border-color: var(--saffron); }
@media (max-width: 599px) {
  .chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 -20px; padding: 2px 20px 4px; scroll-padding: 0 20px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: none; white-space: nowrap; }
}
.chip[aria-pressed="true"] { border-color: var(--saffron-deep); background: color-mix(in srgb, var(--saffron) 16%, var(--surface)); }
.sheet-foot { position: sticky; bottom: -20px; display: grid; gap: 10px; margin: 0 -20px -20px; padding: 12px 20px 20px; background: var(--surface); box-shadow: 0 -10px 16px -12px rgba(0,0,0,.18); }
@media (max-width: 599px) { .sheet-foot { padding-bottom: calc(20px + env(safe-area-inset-bottom)); margin-bottom: calc(-20px - env(safe-area-inset-bottom)); bottom: calc(-20px - env(safe-area-inset-bottom)); } }
#form-status { margin: 0; min-height: 0; font-weight: 600; font-size: 14px; }
#form-status:empty, #turnstile:empty { display: none; }
#turnstile { margin-bottom: -10px; } /* invisible until a challenge is needed; cancel its gap */
#form-status.ok { color: var(--green); }
#form-status.err { color: #D32F2F; }
.fine { margin: 0; text-align: center; font-size: 12px; color: var(--muted); }

/* ---------- Celebration ---------- */
.celebrate {
  width: min(440px, calc(100vw - 32px)); text-align: center; overflow: hidden;
  background: var(--surface); border-radius: 28px; padding: 28px 22px 22px; box-shadow: 0 20px 60px rgba(0,0,0,.35);
}
.celebrate[open] { animation: pop .3s ease-out; }
.hoist { position: relative; height: 150px; width: 160px; margin: 0 auto 8px; }
.hoist .pole { position: absolute; left: 30px; bottom: 0; width: 5px; height: 150px; border-radius: 3px; background: linear-gradient(90deg, #8a6a3d, #c9a36a, #8a6a3d); }
.hoist .pole::before { content: ""; position: absolute; top: -6px; left: -3px; width: 11px; height: 11px; border-radius: 50%; background: #D4AF37; }
.hoist .big-flag { position: absolute; left: 35px; top: 4px; width: 105px; height: 70px; transform-origin: left center; }
.celebrate[open] .big-flag { animation: hoist 1.4s cubic-bezier(.2,.8,.2,1) both, flutter 2.4s 1.4s ease-in-out infinite; }
@keyframes hoist { from { transform: translateY(78px); } to { transform: translateY(0); } }
@keyframes flutter { 50% { transform: skewY(-3deg) scaleX(.95); } }
.celebrate-kicker { margin: 0; font: 800 1rem var(--font-display); color: var(--saffron-deep); letter-spacing: .06em; text-transform: uppercase; }
.celebrate h2 { margin: 4px 0 6px; font-size: 1.75rem; }
.rank { margin: 0 0 18px; color: var(--muted); }
.rank strong { color: var(--heading); font-size: 1.1rem; }
.share-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 10px; }
.share-row .btn-wa, .share-row .btn-story { flex-basis: 100%; }
.btn-story { background: linear-gradient(45deg, #F58529, #DD2A7B 55%, #8134AF); color: #fff; font: 700 17px/1 var(--font-display); min-height: 50px; box-shadow: 0 6px 18px rgba(221, 42, 123, .3); }
.btn-story:disabled { opacity: .7; cursor: progress; }
.share-hint { flex-basis: 100%; margin: -2px 0 4px; font-size: 13px; color: var(--muted); }
.confetti { position: absolute; inset: 0; pointer-events: none; }
.confetti i { position: absolute; top: -12px; width: 8px; height: 12px; border-radius: 2px; opacity: 0; }
.celebrate[open] .confetti i { animation: fall 2.6s ease-in forwards; }
@keyframes fall {
  0% { opacity: 1; transform: translateY(0) rotate(0); }
  100% { opacity: 0; transform: translateY(520px) rotate(540deg); }
}

/* ---------- Map bits ---------- */
#map path.state { fill: var(--land); stroke: var(--land-line); transition: fill .4s ease; }
#map path.state.l1 { fill: var(--shade-1); }
#map path.state.l2 { fill: var(--shade-2); }
#map path.state.l3 { fill: var(--shade-3); }
#map path.state.l4 { fill: var(--shade-4); }
.leaflet-tooltip.state-tip { font: 600 12px var(--font); border-radius: 8px; padding: 4px 8px; }
.leaflet-container { font-family: var(--font); }
.leaflet-bar { border: 1px solid var(--border) !important; border-radius: 12px !important; overflow: hidden; box-shadow: var(--shadow) !important; }
.leaflet-bar a { background: var(--surface) !important; color: var(--text) !important; border-color: var(--border) !important; }
.leaflet-bar a.leaflet-disabled { color: var(--muted) !important; opacity: .5; }
.leaflet-control-attribution { background: color-mix(in srgb, var(--surface) 80%, transparent) !important; color: var(--muted) !important; }
.leaflet-popup-content-wrapper { border-radius: 14px; }
.leaflet-popup-content { margin: 12px 16px; min-width: 160px; overflow-wrap: anywhere; }
.p-name { font-weight: 700; font-size: 14px; }
.p-city { color: #777; font-size: 12px; }
.p-msg { margin-top: 6px; font-size: 14px; }
.p-cta { margin-top: 8px; }
.p-cta button { font: 600 13px var(--font); border: 0; border-radius: 999px; padding: 7px 12px; background: var(--saffron-deep); color: #fff; cursor: pointer; }

.flag-icon, .ghost-icon { background: none; border: 0; }
.flag-icon svg { overflow: visible; filter: drop-shadow(0 1px 1px rgba(0,0,0,.25)); }
.flag-icon .cloth { transform-origin: 3px 4px; animation: wave 2.4s ease-in-out infinite; }
.flag-icon.raise svg { animation: raise 1.1s ease-out; }
.flag-icon.mine svg { filter: drop-shadow(0 0 6px rgba(255, 153, 51, .9)); }
@keyframes wave { 50% { transform: skewY(-4deg) scaleX(.94); } }
@keyframes raise { from { transform: translateY(18px); opacity: 0; } }
.ghost-icon div {
  width: 10px; height: 10px; border-radius: 50%; border: 1.5px dashed var(--muted); background: transparent; opacity: .75;
  animation: breathe 2.8s ease-in-out infinite;
}
@keyframes breathe { 50% { transform: scale(1.25); opacity: .6; } }

.marker-cluster-tiranga {
  background: radial-gradient(circle at 50% 50%, #fff 52%, transparent 53%), conic-gradient(var(--saffron) 0 33%, #fff 0 66%, var(--green) 0);
  border-radius: 50%; display: grid; place-items: center;
  color: var(--navy); font: 800 13px var(--font); box-shadow: 0 2px 10px rgba(0,0,0,.3);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
