/* ============================================================
   Cheapest Beer NYC — map-first, dive-bar-at-night visual system
   Signature: neon price-tags scattered on a dark map; the cheapest
   pin glows hot-pink. Everything else stays quiet.
   ============================================================ */

:root {
  --bg: #131110;          /* warm near-black: the bar at night */
  --bg-raise: #1c1917;    /* raised surfaces (overlay, popups)  */
  --bg-sink: #0d0b0a;     /* map well                           */
  --line: #2c2723;        /* hairline dividers                  */
  --ink: #f3ede1;         /* chalk white                        */
  --muted: #9a8f7d;       /* taupe secondary text               */
  --amber: #ffb62c;       /* beer neon — the primary            */
  --pink: #ff3d7f;        /* cheapest / happy-hour-live neon     */
  --pink-deep: #b81f56;

  --r-lg: 14px;
  --r-md: 10px;
  --r-sm: 7px;

  --font-display: "Bebas Neue", "Arial Narrow", sans-serif;
  --font-body: "Barlow", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.45;
}

.neon-noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 500;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Masthead ---------- */
.masthead {
  padding: 14px clamp(16px, 4vw, 32px);
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.masthead__mark { display: flex; align-items: center; gap: 12px; }
.masthead__glass {
  font-size: 26px;
  filter: drop-shadow(0 0 10px rgba(255, 182, 44, 0.45));
}
.masthead__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(28px, 5vw, 40px);
  letter-spacing: 0.02em;
  line-height: 0.86;
  color: var(--amber);
  text-shadow: 0 0 16px rgba(255, 182, 44, 0.35), 0 0 2px rgba(255, 182, 44, 0.6);
}
.masthead__sub {
  margin: 3px 0 0;
  font-size: 12px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Map stage ---------- */
.map-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 420px;
}
.map { position: absolute; inset: 0; background: var(--bg-sink); }
.leaflet-container { background: var(--bg-sink); font-family: var(--font-body); }

/* ---------- Recenter ---------- */
.recenter {
  position: absolute;
  z-index: 450;
  top: 120px;
  right: 12px;
  width: 40px; height: 40px;
  display: grid;
  place-items: center;
  font-size: 20px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--bg-raise);
  color: var(--amber);
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
}
.recenter:hover { border-color: var(--amber); }

/* ---------- Status pill ---------- */
.status {
  position: absolute;
  z-index: 440;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  margin: 0;
  max-width: calc(100% - 24px);
  padding: 6px 14px;
  font-size: 12px;
  color: var(--muted);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border: 1px solid var(--line);
  border-radius: 999px;
  text-align: center;
  backdrop-filter: blur(6px);
}

/* ---------- Ad slot (unobtrusive, bottom-left) ---------- */
.ad-slot {
  position: absolute;
  z-index: 440;
  left: 12px;
  bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
  height: 46px;
  padding: 0 12px;
  border: 1px dashed var(--line);
  border-radius: var(--r-sm);
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  background: color-mix(in srgb, var(--bg) 70%, transparent);
}
@media (max-width: 680px) { .ad-slot { display: none; } }

/* ---------- Focus visibility ---------- */
.recenter:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

/* ---------- Price-tag markers ---------- */
.tag {
  --tag-bg: var(--amber);
  --tag-ink: #201400;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 9px;
  font-family: var(--font-display);
  font-size: 17px;
  line-height: 1;
  letter-spacing: 0.01em;
  color: var(--tag-ink);
  background: var(--tag-bg);
  border: 2px solid #201400;
  border-radius: 999px;
  box-shadow: 0 0 12px rgba(255, 182, 44, 0.55);
  white-space: nowrap;
  transform: translateY(-2px);
}
.tag::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -6px;
  width: 8px; height: 8px;
  background: var(--tag-bg);
  border-right: 2px solid #201400;
  border-bottom: 2px solid #201400;
  transform: translateX(-50%) rotate(45deg);
}
.tag--best {
  --tag-bg: var(--pink);
  --tag-ink: #2a0012;
  box-shadow: 0 0 16px rgba(255, 61, 127, 0.75);
}
.tag--hh {
  border-color: var(--pink);
  box-shadow:
    0 0 0 3px rgba(255, 61, 127, 0.32),
    0 0 18px rgba(255, 61, 127, 0.72),
    0 0 12px rgba(255, 182, 44, 0.55);
}
.tag--hh:not(.tag--best) {
  --tag-bg: #ffe08a;
}
.tag__beer {
  margin-right: 5px;
  font-family: var(--font-body);
  font-size: 12px;
  line-height: 1;
  filter: drop-shadow(0 0 4px rgba(42, 0, 18, 0.28));
}
.tag-hover .tag { filter: brightness(1.2); z-index: 999; }
@keyframes pulse { 50% { opacity: 0.3; } }

.pin--user {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 2px #fff, 0 0 14px rgba(255, 255, 255, 0.5);
}

/* ---------- Popups ---------- */
.leaflet-popup-content-wrapper {
  background: var(--bg-raise);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.leaflet-popup-tip { background: var(--bg-raise); border: 1px solid var(--line); }

/* The arrow can slide sideways (--cb-tip-nudge) to keep pointing at the bar
   after the popup is shifted to stay on screen. -20px is Leaflet's own centring
   margin for the 40px-wide tip container. */
.leaflet-popup-tip-container { margin-left: calc(-20px + var(--cb-tip-nudge, 0px)); }

/* Flipped: the popup sits below the marker with the arrow on top pointing up
   (used when there's no room above the marker). Leaflet reserves tip space
   below the body by default; move that reservation to the top and flip the
   arrow so it hangs off the top edge instead of the bottom. */
.leaflet-popup--flipped { margin-top: 20px; margin-bottom: 0; }
.leaflet-popup--flipped .leaflet-popup-tip-container {
  top: 0;
  bottom: auto;
  margin-top: -20px;
}
.leaflet-popup--flipped .leaflet-popup-tip { margin: 11px auto 0; }
.leaflet-popup--hh-live .leaflet-popup-content-wrapper {
  border-color: var(--pink);
  box-shadow:
    0 0 0 1px rgba(255, 182, 44, 0.28),
    0 12px 34px rgba(0, 0, 0, 0.5),
    0 0 24px rgba(255, 61, 127, 0.25);
}
.leaflet-popup--hh-live .leaflet-popup-tip {
  border-color: var(--pink);
}
.leaflet-popup-content { margin: 14px 16px; min-width: 210px; }
.popup__eyebrow {
  font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--pink); margin: 0 0 4px;
}
.popup__name {
  font-family: var(--font-display);
  font-size: 24px; line-height: 0.95; margin: 0;
}
.popup__meta { font-size: 12px; color: var(--muted); margin: 5px 0 0; }
.popup__price-row { display: flex; align-items: baseline; gap: 8px; margin: 10px 0 0; }
.popup__price { font-family: var(--font-display); font-size: 34px; line-height: 0.9; color: var(--amber); }
.popup--hh-live .popup__price { color: var(--pink); text-shadow: 0 0 14px rgba(255, 61, 127, 0.42); }
.popup__beer-badge {
  align-self: center;
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 14px rgba(255, 182, 44, 0.48);
}
.popup__strike { font-family: var(--font-mono); font-size: 12px; color: var(--muted); text-decoration: line-through; }
.popup__note { font-size: 12.5px; color: var(--ink); opacity: 0.82; margin: 8px 0 0; }
.popup__hh {
  display: inline-flex; align-items: center; gap: 6px;
  margin: 10px 0 0; padding: 4px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--pink); border: 1px solid var(--pink-deep); background: rgba(255, 61, 127, 0.08);
}
.popup__hh::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--pink); box-shadow: 0 0 8px var(--pink); animation: pulse 1.6s ease-in-out infinite;
}
.popup__hh--later { color: var(--muted); border-color: var(--line); background: transparent; }
.popup__hh--later::before { background: var(--muted); box-shadow: none; animation: none; }
.popup__links { margin: 12px 0 0; font-size: 12.5px; font-weight: 600; }
.popup__links a { color: var(--amber); text-decoration: none; border-bottom: 1px solid transparent; }
.popup__links a:hover { border-bottom-color: var(--amber); }
.popup__conf { font-family: var(--font-mono); font-size: 10px; color: var(--muted); opacity: 0.7; }
.popup__links a.popup__report { color: var(--pink); }
.popup__links a.popup__report:hover { border-bottom-color: var(--pink); }

/* ---------- Report-a-correction modal ---------- */
.report {
  width: min(92vw, 420px);
  padding: 0;
  color: var(--ink);
  background: var(--bg-raise);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}
.report::backdrop { background: rgba(8, 6, 5, 0.66); backdrop-filter: blur(3px); }
.report__form { position: relative; padding: 22px; display: flex; flex-direction: column; gap: 12px; }
.report__close {
  position: absolute; top: 10px; right: 12px;
  width: 30px; height: 30px; display: grid; place-items: center;
  background: transparent; border: none; color: var(--muted);
  font-size: 22px; line-height: 1; cursor: pointer;
}
.report__close:hover { color: var(--ink); }
.report__title {
  margin: 0; font-family: var(--font-display); font-weight: 400;
  font-size: 28px; letter-spacing: 0.02em; color: var(--amber);
}
.report__sub { margin: -6px 0 2px; font-size: 12.5px; color: var(--muted); }
.report__sub span { color: var(--ink); font-weight: 600; }
.report__cats { border: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.report__cats legend {
  padding: 0; margin: 0 0 6px; font-size: 10px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--pink);
}
.report__cats label { display: flex; align-items: center; gap: 9px; font-size: 13.5px; cursor: pointer; }
.report__cats input { accent-color: var(--pink); width: 16px; height: 16px; }
.report__note-label {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-top: 2px; font-size: 10px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--muted);
}
.report__count { font-family: var(--font-mono); letter-spacing: 0; }
#report-message {
  width: 100%; min-height: 68px; resize: vertical;
  padding: 9px 11px; font-family: var(--font-body); font-size: 13.5px;
  color: var(--ink); background: var(--bg-sink);
  border: 1px solid var(--line); border-radius: var(--r-sm);
}
#report-message:focus-visible { outline: none; border-color: var(--amber); }
.report__hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.report__status { margin: 0; min-height: 16px; font-size: 12px; color: var(--pink); }
.report__actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }
.report__cancel, .report__submit {
  font-family: var(--font-body); font-weight: 700; font-size: 13px; letter-spacing: 0.03em;
  padding: 9px 16px; border-radius: 999px; cursor: pointer;
}
.report__cancel { background: transparent; border: 1px solid var(--line); color: var(--muted); }
.report__cancel:hover { border-color: var(--muted); color: var(--ink); }
.report__submit { background: var(--amber); border: 1px solid var(--amber); color: #201400; }
.report__submit:hover { filter: brightness(1.08); }
.report__submit:disabled { opacity: 0.55; cursor: default; }
.report__cats input:focus-visible,
.report__cancel:focus-visible,
.report__submit:focus-visible,
.report__close:focus-visible {
  outline: 2px solid var(--amber); outline-offset: 2px;
}

/* ---------- Footer ---------- */
.footer {
  padding: 12px clamp(16px, 4vw, 32px);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11.5px;
  background: var(--bg);
}

@media (max-width: 680px) {
  .status { bottom: 74px; }
  .recenter { top: 100px; }
}

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