:root {
  --saffron: #ff7a00;
  --saffron-dark: #e56600;
  --chili: #e63946;
  --mint: #2ecc71;
  --tamarind: #4a2c13;
  --cream: #fff8ed;
  --paper: #fffdf9;
  --shadow: rgba(74, 44, 19, 0.18);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: 'Fredoka', system-ui, sans-serif;
  background: linear-gradient(180deg, #fff3e0 0%, #ffe4c4 100%);
  color: var(--tamarind);
  overflow: hidden;
  touch-action: none; /* only the map itself should ever pinch-zoom */
}

/* ---------- Background decoration ---------- */
.bg-decor {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.bg-decor span {
  position: absolute;
  bottom: -10%;
  font-size: 28px;
  opacity: 0.18;
  animation: floatUp 14s linear infinite;
}
.bg-decor span img {
  display: block;
  width: 30px;
  height: auto;
}
@keyframes floatUp {
  0%   { transform: translateY(0) rotate(0deg); opacity: 0; }
  10%  { opacity: 0.18; }
  90%  { opacity: 0.18; }
  100% { transform: translateY(-110vh) rotate(25deg); opacity: 0; }
}

/* ---------- Top bar ---------- */
.topbar {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: var(--paper);
  box-shadow: 0 2px 10px var(--shadow);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-logo {
  height: 46px;
  width: auto;
}
.brand h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--saffron-dark);
  line-height: 1.1;
}
.tagline {
  margin: 0;
  font-size: 11px;
  color: #8a6a4a;
}

.badge-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--saffron), var(--chili));
  color: white;
  padding: 6px 12px;
  border-radius: 999px;
  box-shadow: 0 2px 8px var(--shadow);
  white-space: nowrap;
}
.badge-icon { font-size: 18px; }
.badge-text { display: flex; flex-direction: column; line-height: 1.2; }
.badge-text strong { font-size: 12px; }
.badge-text span { font-size: 10px; opacity: 0.9; }

/* ---------- Map ---------- */
#map {
  position: absolute;
  inset: 0;
  top: 62px;
  z-index: 1;
}
.leaflet-container { background: #e8f4f0; font-family: 'Fredoka', sans-serif; }

.puri-marker {
  filter: drop-shadow(0 3px 3px rgba(0,0,0,0.35));
  animation: dropIn 0.5s cubic-bezier(.34,1.56,.64,1);
  cursor: pointer;
}
/* 4+ average rating — a quiet golden glow, no click required to spot it */
.puri-marker-top {
  filter: drop-shadow(0 3px 3px rgba(0,0,0,0.35)) drop-shadow(0 0 7px rgba(255,183,3,0.85));
}
@keyframes dropIn {
  0%   { transform: translateY(-40px) scale(0.3); opacity: 0; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

/* Inline panipuri icon (replaces the 🥙 emoji wherever it was used) */
.puri-icon {
  width: 16px;
  height: auto;
  vertical-align: middle;
  display: inline-block;
}
.puri-icon-lg { width: 22px; }
.puri-icon-empty { opacity: 0.25; filter: grayscale(70%); }

.puri-popup h3 { margin: 0 0 4px; font-size: 15px; color: var(--saffron-dark); }
.puri-popup .stars { font-size: 13px; margin: 2px 0; }
.puri-popup .avg-num { font-size: 11px; color: #a08768; margin-left: 2px; }
.puri-popup .notes { font-size: 12px; font-style: italic; margin: 6px 0; color: #5a4632; }
.puri-popup .meta { font-size: 10px; color: #a08768; }

.vote-row {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}
.vote-btn {
  flex: 1;
  border: 1.5px solid #f0d9bb;
  background: #fffaf3;
  border-radius: 8px;
  padding: 5px 6px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  color: var(--tamarind);
}

.rate-row { margin-top: 8px; }
.rate-prompt { margin: 0 0 4px; font-size: 11px; font-weight: 600; color: #6a4c2f; }
.mini-rating-group {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 5px;
}
.mini-rating-label {
  font-size: 10px;
  color: #8a6a4a;
  width: 44px;
  flex-shrink: 0;
}
.mini-rating {
  display: flex;
  gap: 3px;
}
.mini-rating button {
  border: none;
  background: #f4e6d2;
  border-radius: 6px;
  font-size: 13px;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0.4;
}
.mini-rating button img { width: 13px; }
.mini-rating button.active {
  opacity: 1;
  background: #ffe3b8;
}
.mini-submit {
  width: 100%;
  border: none;
  border-radius: 8px;
  padding: 6px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  color: white;
  background: linear-gradient(135deg, var(--saffron), var(--chili));
  cursor: pointer;
}
.mini-submit:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.voted-msg {
  margin-top: 8px;
  font-size: 12px;
  color: var(--saffron-dark);
  font-weight: 600;
}

.puri-popup .navigate-btn {
  display: block;
  text-align: center;
  margin-top: 8px;
  padding: 7px 10px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--saffron), var(--chili));
  color: white;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}

/* ---------- You-are-here marker ---------- */
.you-are-here { position: relative; width: 26px; height: 26px; }
.you-are-here .dot {
  position: absolute;
  top: 50%; left: 50%;
  width: 20px; height: 20px;
  background: #4285f4;
  border: 4px solid #fff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
  z-index: 2;
}
.you-are-here .pulse {
  position: absolute;
  top: 50%; left: 50%;
  width: 26px; height: 26px;
  background: rgba(66, 133, 244, 0.35);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: pulseRing 1.8s ease-out infinite;
  z-index: 1;
}
@keyframes pulseRing {
  0%   { transform: translate(-50%, -50%) scale(0.6); opacity: 0.7; }
  100% { transform: translate(-50%, -50%) scale(2.8); opacity: 0; }
}

/* ---------- Floating action buttons ---------- */
.fab-stack {
  position: fixed;
  right: 18px;
  bottom: 60px; /* cleared of Netlify's "Powered by" badge in the corner */
  z-index: 15;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}
.fab {
  border: none;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 4px 14px var(--shadow);
  transition: transform 0.15s ease;
}
.fab:active { transform: scale(0.94); }
.fab-primary {
  background: linear-gradient(135deg, var(--saffron), var(--chili));
  color: white;
  font-size: 16px;
  font-weight: 600;
  padding: 14px 20px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.fab-primary:hover { transform: translateY(-2px); }
.fab-emoji { font-size: 20px; }
.fab-secondary {
  background: var(--paper);
  color: var(--saffron-dark);
  font-size: 20px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
}

/* ---------- Placing hint ---------- */
.placing-hint {
  position: fixed;
  top: 74px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  background: var(--tamarind);
  color: var(--cream);
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 14px var(--shadow);
}
.placing-hint button {
  background: var(--saffron);
  border: none;
  color: white;
  padding: 4px 10px;
  border-radius: 8px;
  font-family: inherit;
  cursor: pointer;
  font-size: 12px;
}

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(74, 44, 19, 0.45);
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-card {
  background: var(--paper);
  border-radius: 20px;
  padding: 22px 22px 18px;
  width: 100%;
  max-width: 380px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 12px 40px rgba(0,0,0,0.3);
  animation: popIn 0.25s cubic-bezier(.34,1.56,.64,1);
}
@keyframes popIn {
  0% { transform: scale(0.85); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
.modal-card h2 {
  margin: 0 0 14px;
  font-size: 19px;
  color: var(--saffron-dark);
}
.modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  border: none;
  background: none;
  font-size: 16px;
  cursor: pointer;
  color: var(--tamarind);
}
#spotForm label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #6a4c2f;
  margin-bottom: 12px;
}
.optional { font-weight: 400; color: #a08768; }
#spotForm input[type="text"],
#spotForm textarea {
  width: 100%;
  margin-top: 5px;
  padding: 9px 10px;
  border-radius: 10px;
  border: 1.5px solid #f0d9bb;
  font-family: inherit;
  font-size: 14px;
  background: #fffaf3;
  resize: none;
}
#spotForm input:focus, #spotForm textarea:focus {
  outline: none;
  border-color: var(--saffron);
}
.rating-row {
  display: flex;
  gap: 4px;
  margin-top: 5px;
}
.rating-row button {
  border: none;
  background: #f4e6d2;
  border-radius: 8px;
  font-size: 18px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0.4;
  transition: transform 0.1s ease, opacity 0.1s ease;
}
.rating-row button.active {
  opacity: 1;
  background: #ffe3b8;
  transform: scale(1.12);
}
.submit-btn {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--saffron), var(--chili));
  color: white;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 4px;
}
.submit-btn:active { transform: scale(0.98); }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--tamarind);
  color: var(--cream);
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  z-index: 40;
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
  animation: toastIn 0.3s ease;
}
@keyframes toastIn {
  0% { transform: translate(-50%, 20px); opacity: 0; }
  100% { transform: translate(-50%, 0); opacity: 1; }
}

.hidden { display: none !important; }

/* ---------- Small screens ---------- */
@media (max-width: 420px) {
  .tagline { display: none; }
  .badge-text span { display: none; }
}
