:root {
  color-scheme: light;
  --ink: #20272d;
  --muted: #64707a;
  --line: #cbd3da;
  --field: #f2f5f7;
  --paper: #e5e9ed;
  --panel: #f8fafb;
  --panel-soft: #dce2e7;
  --dark: #29323a;
  --grass: #2f6f48;
  --gold: #c49a2f;
  --nfl: #d63b2f;
  --ncaa: #4bb7f0;
  --tailgater: #4f7898;
  --tailgater-dark: #263d50;
  --tailgater-active: #d8a84c;
  --brick: var(--nfl);
  --sky: #dcebf5;
  --shadow: 0 18px 50px rgba(31, 42, 52, 0.18);
  --topbar-height: 124px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  height: 100vh;
  overflow: hidden;
  background: #d9dee3;
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

.topbar {
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px clamp(18px, 4vw, 42px);
  background: linear-gradient(90deg, #d8dee4 0%, #c4ccd4 48%, #9eabb6 100%);
  color: var(--ink);
  border-bottom: 1px solid #b5c0c9;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-logo {
  width: 118px;
  height: 104px;
  flex: 0 0 auto;
  object-fit: cover;
  object-position: center;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 18px;
  background: transparent;
  box-shadow: 0 10px 18px rgba(31, 42, 52, 0.18);
  clip-path: polygon(10% 0, 90% 0, 100% 10%, 100% 84%, 50% 100%, 0 84%, 0 10%);
}

.eyebrow {
  margin: 0 0 4px;
  color: #8a5f12;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

h1 {
  max-width: 720px;
  margin: 0;
  font-family: "Bebas Neue", Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  font-size: clamp(2.5rem, 4.1vw, 4.55rem);
  line-height: 0.92;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

h1 span {
  color: #ffcf70;
}

.auth-chip {
  flex: 0 0 auto;
  padding: 9px 12px;
  border: 1px solid rgba(54, 65, 76, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.34);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 700;
  backdrop-filter: blur(8px);
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(340px, 430px) minmax(0, 1fr);
  gap: 0;
  height: calc(100vh - var(--topbar-height));
  min-height: 0;
  overflow: hidden;
}

.search-panel {
  min-width: 0;
  padding: 22px;
  background: var(--paper);
  border-right: 1px solid var(--line);
  overflow: auto;
}

.search-form {
  display: grid;
  gap: 16px;
}

.search-form label,
.radius-row label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.search-box {
  position: relative;
  min-width: 0;
}

input[type="search"] {
  width: 100%;
  min-width: 0;
  height: 44px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  color: var(--ink);
}

.suggestions {
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  z-index: 900;
  display: none;
  width: min(520px, calc(100vw - 56px));
  max-height: 430px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 18px 36px rgba(31, 42, 52, 0.2);
}

.suggestions.open {
  display: block;
}

.suggestion {
  width: 100%;
  display: grid;
  gap: 11px;
  min-height: 0;
  padding: 16px;
  border: 0;
  border-radius: 0;
  background: var(--panel);
  color: var(--ink);
  text-align: left;
}

.suggestion:hover,
.suggestion.active {
  background: #edf2f5;
}

.suggestion + .suggestion {
  border-top: 6px solid #e1e7eb;
}

.suggestion-title {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 900;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.suggestion-meta {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  column-gap: 10px;
  row-gap: 5px;
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.25;
}

.suggestion-meta > span:not(.suggestion-chip) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
}

.suggestion-location {
  grid-column: 2;
  color: var(--muted);
}

.suggestion-chip {
  flex: 0 0 auto;
  grid-row: 1 / 3;
  justify-self: start;
  min-width: 42px;
  padding: 3px 6px;
  border-radius: 5px;
  color: #fff;
  font-size: 0.66rem;
  font-weight: 950;
  line-height: 1;
  text-align: center;
}

.suggestion-chip.nfl {
  background: var(--nfl);
}

.suggestion-chip.ncaa {
  background: var(--ncaa);
  color: #0d3144;
}

input[type="search"]:focus {
  outline: 3px solid rgba(196, 154, 47, 0.26);
  border-color: var(--gold);
}

button {
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  background: #2f6f48;
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.search-row button {
  padding: 0 18px;
}

.radius-row {
  display: grid;
  gap: 8px;
}

input[type="range"] {
  accent-color: var(--brick);
}

.filter-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.filter-button {
  background: var(--panel-soft);
  color: var(--ink);
}

.filter-button.active {
  background: var(--dark);
  color: #fff;
}

.filter-button:hover {
  background: #cfd7de;
  color: var(--ink);
}

.filter-button.active:hover {
  background: var(--dark);
  color: #fff;
}

.summary {
  margin: 22px 0 12px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.results {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.result-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 5px 18px rgba(31, 42, 52, 0.08);
  cursor: pointer;
}

.result-card:hover,
.result-card:focus-within {
  border-color: rgba(47, 111, 72, 0.42);
  box-shadow: 0 10px 22px rgba(31, 42, 52, 0.12);
}

.result-card h2 {
  margin: 0 0 6px;
  font-size: 1rem;
  letter-spacing: 0;
}

.result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #e4e9ed;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 800;
}

.identity {
  margin: 10px 0 0;
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 850;
  line-height: 1.35;
}

.lots {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.map-panel {
  min-width: 0;
  min-height: 0;
  position: relative;
}

#map {
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.leaflet-container {
  font: inherit;
}

.map-details {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 500;
  display: grid;
  gap: 4px;
  width: min(430px, calc(100% - 36px));
  max-width: min(430px, calc(100% - 36px));
  max-height: calc(100% - 36px);
  overflow: auto;
  padding: 14px;
  border: 1px solid rgba(54, 65, 76, 0.18);
  border-radius: 8px;
  background: rgba(248, 250, 251, 0.96);
  box-shadow: var(--shadow);
  color: var(--ink);
}

.map-details.tailgate-detail {
  top: 18px;
  bottom: 18px;
  width: min(620px, calc(100% - 36px));
  max-width: min(620px, calc(100% - 36px));
}

.map-details.profile-detail {
  width: min(480px, calc(100% - 36px));
  max-width: min(480px, calc(100% - 36px));
}

.map-details.closed {
  display: none;
}

.map-details-head {
  position: sticky;
  top: -14px;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
  margin: -14px -14px 6px;
  padding: 14px;
  border-bottom: 1px solid rgba(54, 65, 76, 0.12);
  background: rgba(248, 250, 251, 0.98);
}

.map-details-body {
  display: grid;
  gap: 4px;
}

.map-details-close {
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid rgba(54, 65, 76, 0.18);
  border-radius: 7px;
  background: #e6ebef;
  color: var(--ink);
  font-size: 0.72rem;
}

.map-details strong {
  font-size: 1rem;
}

.map-details span,
.map-details small {
  color: var(--muted);
  line-height: 1.35;
}

.fact-list {
  display: grid;
  gap: 4px;
  margin: 6px 0 0;
  padding: 0 0 0 18px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.nearby-tailgaters {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.nearby-tailgaters summary {
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 900;
}

.tailgater-list {
  display: grid;
  gap: 6px;
  max-height: 260px;
  overflow: auto;
  padding-right: 3px;
  margin-top: 8px;
}

.tailgater-list button {
  display: grid;
  gap: 2px;
  min-height: 0;
  padding: 8px 9px;
  border: 1px solid rgba(54, 65, 76, 0.14);
  border-radius: 8px;
  background: #eef3f6;
  color: var(--ink);
  text-align: left;
}

.tailgater-list button:hover {
  border-color: rgba(79, 120, 152, 0.4);
  background: #e3ebf0;
}

.tailgater-list button span {
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 900;
}

.tailgate-section,
.profile-section {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.tailgate-section h3,
.profile-section h3 {
  margin: 0;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
}

.section-head small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.35;
}

.upload-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid rgba(54, 65, 76, 0.16);
  border-radius: 8px;
  background: #263d50;
  color: #fff;
  font-size: 0.76rem;
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
}

.upload-button:hover {
  background: #335670;
}

.upload-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.photo-card {
  position: relative;
  min-height: 138px;
  margin: 0;
  border: 1px solid rgba(54, 65, 76, 0.14);
  border-radius: 8px;
  background: #253849;
  color: #fff;
  overflow: hidden;
}

.tailgate-detail .photo-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tailgate-detail .photo-card {
  min-height: 152px;
}

.photo-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-card.uploaded {
  border-color: rgba(47, 111, 72, 0.34);
}

.photo-card figcaption {
  position: absolute;
  inset: auto 0 0;
  display: grid;
  gap: 2px;
  padding: 28px 9px 8px;
  background: linear-gradient(0deg, rgba(20, 29, 38, 0.88), rgba(20, 29, 38, 0));
}

.photo-card figcaption span {
  color: #fff;
  font-size: 0.82rem;
  font-weight: 900;
}

.photo-card figcaption small {
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.68rem;
  line-height: 1.25;
}

.rsvp-list {
  display: grid;
  gap: 10px;
  max-height: 320px;
  overflow: auto;
  padding: 2px 5px 2px 0;
}

.rsvp-list button,
.host-profile-link {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 64px;
  align-content: center;
  padding: 11px 12px;
  border: 1px solid rgba(54, 65, 76, 0.14);
  border-radius: 8px;
  background: #eef3f6;
  color: var(--ink);
  text-align: left;
}

.rsvp-list button > span:last-child,
.host-profile-link > span:last-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.rsvp-list button:hover,
.host-profile-link:hover,
.profile-back:hover {
  border-color: rgba(79, 120, 152, 0.4);
  background: #e3ebf0;
}

.rsvp-list button strong,
.host-profile-link strong {
  display: block;
  color: var(--ink);
  font-size: 0.84rem;
  line-height: 1.2;
}

.rsvp-list button small,
.host-profile-link small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.25;
}

.avatar {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: linear-gradient(145deg, #6f97b7, #263d50);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 900;
}

.avatar.large {
  width: 48px;
  height: 48px;
  font-size: 0.9rem;
}

.profile-back {
  justify-self: start;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(54, 65, 76, 0.14);
  border-radius: 8px;
  background: #eef3f6;
  color: var(--ink);
  font-size: 0.75rem;
  font-weight: 900;
}

.profile-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(54, 65, 76, 0.12);
  border-radius: 8px;
  background: #eef3f6;
}

.social-grid {
  display: grid;
  gap: 5px;
  font-size: 0.75rem;
  color: var(--muted);
}

.profile-section ul {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 0.76rem;
}

.ticket-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  margin-top: 8px;
  padding: 8px 11px;
  border-radius: 8px;
  background: var(--dark);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 900;
  text-decoration: none;
}

.ticket-link.disabled {
  opacity: 0.62;
  cursor: not-allowed;
}

.tailgater-marker {
  position: relative;
  width: 42px;
  height: 42px;
  min-height: 0;
  display: grid;
  place-items: center;
  border: 3px solid #fff;
  border-radius: 50% 50% 50% 12px;
  background: linear-gradient(145deg, #6f97b7 0%, var(--tailgater) 52%, var(--tailgater-dark) 100%);
  box-shadow: 0 12px 24px rgba(38, 61, 80, 0.24);
  color: #fff;
}

.tailgater-marker::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -7px;
  z-index: -1;
  width: 16px;
  height: 16px;
  border-right: 3px solid #fff;
  border-bottom: 3px solid #fff;
  border-radius: 0 0 5px 0;
  background: var(--tailgater-dark);
  transform: translateX(-50%) rotate(45deg);
}

.tailgater-marker-icon {
  position: relative;
  z-index: 2;
  display: block;
  width: 24px;
  height: 18px;
}

.tailgater-marker-icon span {
  position: absolute;
  display: block;
  border-radius: 999px;
  background: #fff;
}

.tailgater-marker-icon span:nth-child(1) {
  left: 8px;
  top: 0;
  width: 8px;
  height: 8px;
}

.tailgater-marker-icon span:nth-child(2),
.tailgater-marker-icon span:nth-child(3) {
  top: 8px;
  width: 10px;
  height: 10px;
}

.tailgater-marker-icon span:nth-child(2) {
  left: 2px;
}

.tailgater-marker-icon span:nth-child(3) {
  right: 2px;
}

.tailgater-marker.active {
  border-color: var(--tailgater-active);
  box-shadow: 0 0 0 7px rgba(216, 168, 76, 0.32), 0 14px 28px rgba(38, 61, 80, 0.3);
}

.map-error {
  position: absolute;
  left: 50%;
  top: 28px;
  z-index: 650;
  display: none;
  width: min(440px, calc(100% - 36px));
  padding: 14px;
  border: 1px solid rgba(214, 59, 47, 0.3);
  border-radius: 8px;
  background: rgba(248, 250, 251, 0.96);
  box-shadow: var(--shadow);
  color: var(--ink);
  transform: translateX(-50%);
}

.map-error.open {
  display: grid;
  gap: 5px;
}

.map-error strong {
  color: var(--nfl);
}

.map-error span {
  color: var(--muted);
  line-height: 1.35;
}

.map-footer {
  position: absolute;
  left: 18px;
  bottom: 18px;
  z-index: 500;
  display: grid;
  justify-items: start;
  gap: 8px;
}

.map-legend {
  display: flex;
  gap: 8px;
  padding: 9px;
  border: 1px solid rgba(54, 65, 76, 0.16);
  border-radius: 8px;
  background: rgba(248, 250, 251, 0.95);
  box-shadow: 0 10px 24px rgba(31, 42, 52, 0.14);
  font-size: 0.82rem;
  font-weight: 900;
}

.map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.map-legend i {
  width: 24px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  border-radius: 5px;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(23, 33, 28, 0.18);
}

.legend-nfl {
  background: var(--nfl);
}

.legend-ncaa {
  background: var(--ncaa);
}

.legend-tailgater {
  background: var(--tailgater);
}

.dataset-note {
  max-width: min(320px, calc(100vw - 56px));
  padding: 8px 10px;
  border: 1px solid rgba(54, 65, 76, 0.14);
  border-radius: 8px;
  background: rgba(248, 250, 251, 0.94);
  box-shadow: 0 10px 24px rgba(31, 42, 52, 0.12);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
}

@media (max-width: 860px) {
  body {
    height: auto;
    min-height: 100vh;
    overflow: auto;
  }

  .topbar {
    align-items: start;
    flex-direction: column;
    height: auto;
    min-height: 132px;
  }

  .brand-logo {
    width: 108px;
    height: 78px;
  }

  .app-shell {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
  }

  .search-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .map-panel,
  #map {
    min-height: 520px;
  }

  .map-details.tailgate-detail,
  .map-details.profile-detail {
    top: 18px;
    bottom: 18px;
    width: calc(100% - 36px);
    max-width: calc(100% - 36px);
  }
}

@media (max-width: 520px) {
  .search-panel {
    padding: 16px;
  }

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

  .summary {
    display: grid;
  }

  .photo-grid {
    grid-template-columns: 1fr;
  }

  .section-head {
    grid-template-columns: 1fr;
  }
}
