:root {
  --bg: #090909;
  --panel: #131313;
  --ink: #f6efdc;
  --muted: #d6ccb1;
  --gold: #c89a3c;
  --gold-soft: #f0d59f;
  --green: #0f5d3e;
  --danger: #b95454;
  --stroke: rgba(246, 239, 220, 0.16);
  --shadow: 0 14px 34px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 0%, rgba(200, 154, 60, 0.2), transparent 36%),
    radial-gradient(circle at 92% 14%, rgba(15, 93, 62, 0.2), transparent 34%),
    linear-gradient(180deg, #080808 0%, #111111 45%, #0b0b0b 100%);
}

.page-shell {
  max-width: 1380px;
  margin: 0 auto;
  padding: 1.4rem 1rem 1rem;
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.topbar {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.2rem;
  align-items: end;
  margin-bottom: 1rem;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.brand-logo {
  width: 74px;
  height: 74px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid rgba(200, 154, 60, 0.5);
  box-shadow: 0 0 0 3px rgba(200, 154, 60, 0.1);
}

.eyebrow {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-soft);
}

h1 {
  margin: 0;
  line-height: 1;
  font-size: clamp(2rem, 4.2vw, 3.4rem);
  font-family: "Cormorant Garamond", serif;
  font-weight: 700;
}

.topbar-copy {
  margin: 0;
  justify-self: end;
  max-width: 620px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.95fr);
  gap: 1rem;
  min-height: 0;
  height: 100%;
  align-items: stretch;
}

.map-panel,
.results-panel {
  background: linear-gradient(180deg, rgba(22, 22, 22, 0.92) 0%, rgba(13, 13, 13, 0.94) 100%);
  border: 1px solid var(--stroke);
  border-radius: 16px;
  box-shadow: var(--shadow);
  min-height: 0;
  height: 100%;
}

.map-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  padding: 1rem;
  gap: 0.8rem;
}

.search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px auto auto;
  gap: 0.55rem;
  align-items: end;
}

input[type="text"],
input[type="number"] {
  width: 100%;
  border: 1px solid rgba(246, 239, 220, 0.22);
  background: rgba(0, 0, 0, 0.36);
  color: var(--ink);
  border-radius: 10px;
  padding: 0.7rem 0.9rem;
  font-size: 0.95rem;
}

input[type="text"]::placeholder {
  color: rgba(246, 239, 220, 0.55);
}

.radius-wrap {
  display: grid;
  gap: 0.26rem;
}

.radius-wrap label {
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

button {
  border: 0;
  border-radius: 10px;
  padding: 0.68rem 1rem;
  font-weight: 700;
  color: #101010;
  background: linear-gradient(180deg, #e7c885 0%, #c89a3c 100%);
  cursor: pointer;
  transition: transform 120ms ease, filter 120ms ease;
}

button:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
}

button.secondary {
  color: var(--ink);
  background: rgba(246, 239, 220, 0.12);
  border: 1px solid rgba(246, 239, 220, 0.18);
}

.status {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.status.error {
  color: #ffc4c4;
}

.map {
  width: 100%;
  min-height: 0;
  height: 100%;
  border: 1px solid rgba(246, 239, 220, 0.18);
  border-radius: 12px;
  overflow: hidden;
}

.map.leaflet-container,
.map .leaflet-container {
  height: 100%;
}

.results-panel {
  padding: 1rem;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 0.8rem;
  min-height: 0;
}

.results-head h2 {
  margin: 0;
  font-family: "Cormorant Garamond", serif;
  font-size: 1.8rem;
}

#results-meta {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.results-list {
  overflow: auto;
  padding-right: 0.15rem;
  display: grid;
  gap: 0.72rem;
  align-content: start;
  min-height: 0;
}

.results-disclaimer {
  margin: 0;
  color: rgba(246, 239, 220, 0.72);
  font-size: 0.74rem;
  line-height: 1.4;
  border-top: 1px solid rgba(246, 239, 220, 0.12);
  padding-top: 0.65rem;
}

.placeholder-card,
.result-card {
  border: 1px solid rgba(246, 239, 220, 0.12);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02) 0%, rgba(0, 0, 0, 0.16) 100%);
  padding: 0.82rem;
}

.placeholder-card h3 {
  margin: 0 0 0.25rem;
}

.placeholder-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.result-top {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.65rem;
  align-items: start;
}

.rank-badge {
  width: 33px;
  height: 33px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #111;
  background: linear-gradient(180deg, #f1dba8 0%, #ca9f4a 100%);
}

.venue-name {
  margin: 0;
  font-size: 1.03rem;
  font-weight: 700;
}

.venue-address {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.79rem;
}

.score-block {
  text-align: right;
}

.score-main {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
}

.score-main-btn {
  background: transparent;
  border: 0;
  padding: 0;
  border-radius: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.score-main-btn:hover {
  transform: none;
  filter: none;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.score-main-btn:focus-visible {
  outline: 1px solid rgba(242, 211, 143, 0.75);
  outline-offset: 2px;
}

.score-sub {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.74rem;
}

.criteria-grid {
  margin-top: 0.65rem;
  display: grid;
  gap: 0.38rem;
}

.criterion {
  display: grid;
  grid-template-columns: 94px 1fr 36px;
  align-items: center;
  gap: 0.38rem;
  font-size: 0.78rem;
}

.criterion span {
  color: var(--muted);
}

.bar-wrap {
  height: 8px;
  border-radius: 999px;
  background: rgba(246, 239, 220, 0.12);
  overflow: hidden;
}

.bar {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #cfab60 0%, #f4d79d 80%);
}

.criterion strong {
  text-align: right;
  color: var(--ink);
}

.sources {
  margin-top: 0.65rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.36rem;
}

.source-pill {
  appearance: none;
  background: rgba(0, 0, 0, 0.35);
  font-size: 0.72rem;
  border-radius: 999px;
  padding: 0.16rem 0.5rem;
  border: 1px solid rgba(200, 154, 60, 0.34);
  color: var(--gold-soft);
  cursor: pointer;
}

.source-pill:hover {
  border-color: rgba(240, 213, 159, 0.7);
  color: #ffe4ab;
}

.highlight {
  margin-top: 0.6rem;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.35;
  border-left: 2px solid rgba(200, 154, 60, 0.4);
  padding-left: 0.5rem;
}

.result-links {
  margin-top: 0.62rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.result-links a {
  color: #d8c08e;
  font-size: 0.74rem;
  text-decoration: none;
  border-bottom: 1px solid rgba(216, 192, 142, 0.4);
}

.result-links a:hover {
  color: #f7dfa8;
  border-bottom-color: rgba(247, 223, 168, 0.8);
}

.map-popup {
  color: #191919;
  font-family: "Manrope", sans-serif;
}

.map-popup h4 {
  margin: 0 0 0.2rem;
  font-size: 0.96rem;
}

.map-popup p {
  margin: 0;
  font-size: 0.78rem;
}

.marker-rank-label {
  background: transparent;
  border: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.marker-rank-num {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  text-align: center;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  color: rgba(149, 185, 160, 0.84);
  text-shadow: 0 0 1px rgba(0, 0, 0, 0.8), 0 0 3px rgba(0, 0, 0, 0.7);
  pointer-events: none;
  transform: translateY(-0.5px);
}

.marker-rank-num.is-top {
  color: rgba(242, 211, 143, 0.86);
}

.marker-rank-num.is-other {
  color: rgba(149, 185, 160, 0.84);
}

.leaflet-popup-content-wrapper {
  border-radius: 10px;
}

.leaflet-popup-tip {
  background: #fbf2dd;
}

.review-modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 1200;
}

.review-modal[hidden] {
  display: none;
}

.review-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
}

.review-modal-card {
  position: relative;
  width: min(840px, calc(100vw - 1.5rem));
  max-height: min(76vh, 760px);
  overflow: auto;
  background: linear-gradient(180deg, rgba(24, 24, 24, 0.98) 0%, rgba(10, 10, 10, 0.98) 100%);
  border-radius: 14px;
  border: 1px solid rgba(246, 239, 220, 0.18);
  padding: 0.9rem;
  box-shadow: 0 24px 40px rgba(0, 0, 0, 0.55);
}

.review-modal-close {
  position: absolute;
  top: 0.64rem;
  right: 0.64rem;
  background: rgba(246, 239, 220, 0.15);
  color: var(--ink);
  border: 1px solid rgba(246, 239, 220, 0.2);
  padding: 0.35rem 0.6rem;
  font-size: 0.74rem;
}

.review-modal-card h3 {
  margin: 0;
  font-size: 1.2rem;
}

.review-modal-meta {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.review-modal-list {
  margin-top: 0.68rem;
  display: grid;
  gap: 0.45rem;
}

.review-item {
  border: 1px solid rgba(246, 239, 220, 0.12);
  border-radius: 10px;
  padding: 0.6rem;
}

.review-item-date {
  margin: 0;
  font-size: 0.73rem;
  color: var(--gold-soft);
}

.review-item-text {
  margin: 0.2rem 0 0;
  color: var(--ink);
  font-size: 0.8rem;
  line-height: 1.4;
}

.review-item a {
  color: #f4d8a0;
  font-size: 0.74rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (max-width: 1150px) {
  .content-grid {
    grid-template-columns: 1fr;
    min-height: 0;
    height: auto;
  }

  .map-panel,
  .results-panel {
    height: auto;
  }

  .map-panel {
    min-height: 58vh;
  }

  .results-panel {
    max-height: none;
  }

  .map {
    min-height: 52vh;
  }
}

@media (max-width: 720px) {
  .page-shell {
    padding: 0.8rem 0.55rem;
  }

  .topbar {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 0.7rem;
  }

  .topbar-copy {
    justify-self: start;
    font-size: 0.85rem;
  }

  .search-row {
    grid-template-columns: 1fr;
  }

  .radius-wrap label {
    font-size: 0.68rem;
  }

  .criterion {
    grid-template-columns: 84px 1fr 34px;
  }
}
