@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Space+Grotesk:wght@600;700&display=swap");

:root {
  --ink: #171713;
  --paper: #f3efe6;
  --paper-soft: rgba(243, 239, 230, 0.94);
  --acid: #d8f238;
  --orange: #ff5c35;
  --purple: #6f45de;
  --shadow: 0 12px 40px rgba(31, 27, 18, 0.18);
  color: var(--ink);
  font-family: "DM Sans", system-ui, sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html,
body,
.app,
#map {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  background: var(--paper);
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

#map {
  z-index: 0;
  background: #ddd8cc;
}

.leaflet-control-attribution {
  margin-bottom: max(4px, env(safe-area-inset-bottom)) !important;
  font-size: 9px !important;
}

.leaflet-control-zoom {
  display: none;
}

.topbar {
  position: fixed;
  z-index: 500;
  top: 0;
  left: 0;
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: calc(18px + env(safe-area-inset-top)) 18px 0;
  pointer-events: none;
}

.brand {
  pointer-events: auto;
  filter: drop-shadow(0 2px 0 rgba(243, 239, 230, 0.9));
}

.brand__eyebrow {
  display: block;
  margin-bottom: 3px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.brand h1 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(25px, 7.4vw, 37px);
  line-height: 0.82;
  letter-spacing: -0.08em;
  text-transform: uppercase;
}

.round-button {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
  box-shadow: 3px 3px 0 var(--ink);
  cursor: pointer;
}

.round-button:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--ink);
}

.round-button svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.about-button {
  pointer-events: auto;
  font-family: Georgia, serif;
  font-size: 20px;
  font-style: italic;
}

.search-panel {
  position: fixed;
  z-index: 500;
  top: calc(92px + env(safe-area-inset-top));
  left: 14px;
  right: 14px;
  max-width: 480px;
  margin: auto;
}

.search {
  height: 51px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border: 1.5px solid var(--ink);
  border-radius: 15px;
  background: var(--paper-soft);
  box-shadow: 4px 4px 0 var(--ink);
  backdrop-filter: blur(12px);
}

.search svg {
  width: 20px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 2;
}

.search input {
  min-width: 0;
  flex: 1;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
}

.search input::placeholder {
  color: rgba(23, 23, 19, 0.58);
}

.clear-search {
  display: none;
  padding: 4px;
  border: 0;
  background: transparent;
  font-size: 25px;
  line-height: 1;
  cursor: pointer;
}

.clear-search.is-visible {
  display: block;
}

.filter-row {
  display: flex;
  gap: 7px;
  margin-top: 10px;
  overflow-x: auto;
  padding: 0 3px 4px;
  scrollbar-width: none;
}

.filter-row::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  flex: 0 0 auto;
  padding: 8px 13px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: var(--paper-soft);
  box-shadow: 2px 2px 0 var(--ink);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.filter-chip.is-active {
  background: var(--acid);
}

.map-actions {
  position: fixed;
  z-index: 500;
  right: 16px;
  bottom: calc(31px + env(safe-area-inset-bottom));
  display: grid;
  gap: 12px;
  transition: bottom 220ms ease;
}

.event-sheet.is-open ~ .map-actions {
  bottom: 340px;
}

.location-button {
  background: var(--orange);
}

.collection-button {
  position: relative;
  background: var(--purple);
  color: white;
}

.collection-count,
.people-count {
  position: absolute;
  top: -6px;
  right: -5px;
  min-width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  padding: 0 5px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: var(--acid);
  color: var(--ink);
  font-size: 10px;
  font-weight: 800;
}

.collection-count.is-empty,
.people-count.is-empty {
  background: var(--paper);
}

.people-button {
  position: relative;
  background: var(--paper);
}

.people-button.is-sharing {
  background: #2878ff;
  color: white;
  animation: tracking 1.8s infinite;
}

.people-count {
  background: var(--orange);
  color: var(--ink);
}

.location-button.is-tracking {
  animation: tracking 1.8s infinite;
}

@keyframes tracking {
  50% {
    box-shadow: 3px 3px 0 var(--ink), 0 0 0 8px rgba(255, 92, 53, 0.22);
  }
}

.status-pill {
  position: fixed;
  z-index: 500;
  left: 50%;
  bottom: calc(32px + env(safe-area-inset-bottom));
  max-width: calc(100% - 150px);
  transform: translateX(-50%);
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(23, 23, 19, 0.88);
  color: white;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  transition: opacity 200ms ease, bottom 220ms ease;
}

.status-pill.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.event-sheet,
.collection-sheet {
  position: fixed;
  z-index: 1000;
  right: 0;
  bottom: 0;
  left: 0;
  max-height: min(62vh, 520px);
  padding: 12px 22px calc(22px + env(safe-area-inset-bottom));
  overflow-y: auto;
  border-top: 1.5px solid var(--ink);
  border-radius: 24px 24px 0 0;
  background: var(--paper);
  box-shadow: 0 -12px 40px rgba(31, 27, 18, 0.18);
  transform: translateY(105%);
  transition: transform 240ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.event-sheet.is-open,
.collection-sheet.is-open {
  transform: translateY(0);
}

.sheet-handle {
  width: 43px;
  height: 4px;
  margin: 0 auto 15px;
  border-radius: 999px;
  background: rgba(23, 23, 19, 0.25);
}

.sheet-close,
.dialog-close {
  position: absolute;
  top: 12px;
  right: 16px;
  z-index: 1;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 29px;
  line-height: 1;
  cursor: pointer;
}

.collection-header h2 {
  margin: 0 0 8px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 31px;
  letter-spacing: -0.05em;
}

.collection-header p {
  margin: 0 40px 20px 0;
  color: rgba(23, 23, 19, 0.65);
  font-size: 13px;
  line-height: 1.45;
}

.collection-list {
  display: grid;
  gap: 10px;
}

.collection-item {
  width: 100%;
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 11px;
  padding: 12px;
  border: 1.5px solid var(--ink);
  border-radius: 14px;
  background: white;
  text-align: left;
  cursor: pointer;
}

.collection-tick {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  background: var(--purple);
  color: white;
  font-size: 18px;
  font-weight: 800;
}

.collection-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.collection-copy strong {
  overflow: hidden;
  font-family: "Space Grotesk", sans-serif;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.collection-copy small {
  overflow: hidden;
  color: rgba(23, 23, 19, 0.6);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.collection-arrow {
  font-size: 20px;
}

.collection-empty {
  padding: 28px 15px;
  text-align: center;
}

.collection-empty > span {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin: 0 auto 13px;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  background: var(--acid);
  font-size: 25px;
}

.collection-empty h3 {
  margin: 0 0 6px;
  font-family: "Space Grotesk", sans-serif;
}

.collection-empty p {
  max-width: 280px;
  margin: auto;
  color: rgba(23, 23, 19, 0.6);
  font-size: 12px;
  line-height: 1.5;
}

.event-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 12px;
}

.event-tag {
  padding: 5px 9px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--acid);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.collected-tag {
  background: var(--purple);
  color: white;
}

.event-sheet h2,
.about-dialog h2 {
  max-width: 90%;
  margin: 0 0 9px;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(24px, 7vw, 34px);
  line-height: 1;
  letter-spacing: -0.045em;
}

.event-venue {
  margin: 0 0 4px;
  font-weight: 700;
}

.event-address,
.event-description {
  margin: 0 0 14px;
  color: rgba(23, 23, 19, 0.68);
  font-size: 13px;
  line-height: 1.5;
}

.event-description {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.event-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.event-action {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 10px;
  border: 1.5px solid var(--ink);
  border-radius: 12px;
  background: var(--ink);
  color: white;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.event-action.secondary {
  background: var(--paper);
  color: var(--ink);
}

.music-marker {
  background: transparent;
  border: 0;
}

.marker-pin {
  position: relative;
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 50% 50% 50% 8px;
  background: var(--acid);
  box-shadow: 2px 2px 0 var(--ink);
  color: var(--ink);
  font-family: "Space Grotesk", sans-serif;
  font-size: 16px;
  font-weight: 700;
  transform: rotate(-45deg);
}

.marker-pin span {
  transform: rotate(45deg);
}

.music-marker.is-highlighted .marker-pin {
  z-index: 20;
  background: var(--orange);
  transform: rotate(-45deg) scale(1.2);
}

.music-marker.is-collected .marker-pin {
  background: var(--purple);
  color: white;
}

.map-overview .music-marker .marker-pin {
  width: 13px;
  height: 13px;
  border-width: 1.5px;
  border-radius: 50%;
  box-shadow: 1px 1px 0 var(--ink);
}

.map-overview .music-marker .marker-pin span {
  display: none;
}

.user-marker {
  width: 24px;
  height: 24px;
  border: 4px solid white;
  border-radius: 50%;
  background: #2878ff;
  box-shadow: 0 0 0 2px #164dad, 0 0 0 12px rgba(40, 120, 255, 0.18);
}

.person-marker {
  background: transparent;
  border: 0;
}

.person-dot {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 3px solid white;
  border-radius: 50%;
  background: var(--purple);
  box-shadow: 0 0 0 2px var(--ink);
  color: white;
  font-family: "Space Grotesk", sans-serif;
  font-size: 16px;
  font-weight: 700;
}

.person-name {
  position: absolute;
  top: 41px;
  left: 19px;
  max-width: 100px;
  overflow: hidden;
  transform: translateX(-50%);
  padding: 3px 7px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  box-shadow: 1px 1px 0 var(--ink);
  font-size: 10px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.about-dialog,
.share-dialog {
  width: min(calc(100% - 30px), 420px);
  padding: 28px;
  border: 1.5px solid var(--ink);
  border-radius: 22px;
  background: var(--paper);
  box-shadow: 7px 7px 0 var(--ink);
  color: var(--ink);
}

.about-dialog::backdrop,
.share-dialog::backdrop {
  background: rgba(23, 23, 19, 0.45);
  backdrop-filter: blur(3px);
}

.about-dialog p,
.share-dialog p {
  line-height: 1.5;
}

.share-dialog h2 {
  margin: 0 0 10px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 30px;
  letter-spacing: -0.05em;
}

.name-field {
  display: grid;
  gap: 6px;
  margin: 20px 0 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.name-field input {
  width: 100%;
  padding: 13px 14px;
  border: 1.5px solid var(--ink);
  border-radius: 11px;
  background: white;
  outline: none;
  font-size: 16px;
  text-transform: none;
}

.name-field input:focus {
  box-shadow: 3px 3px 0 var(--ink);
}

.share-submit {
  width: 100%;
  padding: 14px;
  border: 1.5px solid var(--ink);
  border-radius: 11px;
  background: #2878ff;
  box-shadow: 3px 3px 0 var(--ink);
  color: white;
  font-weight: 700;
  cursor: pointer;
}

.dialog-note {
  margin-bottom: 0;
  color: rgba(23, 23, 19, 0.58);
  font-size: 12px;
}

@media (min-width: 700px) {
  .topbar {
    padding: 26px 28px;
  }

  .search-panel {
    top: 28px;
  }

  .event-sheet,
  .collection-sheet {
    top: 24px;
    right: 24px;
    bottom: 24px;
    left: auto;
    width: 390px;
    max-height: none;
    border: 1.5px solid var(--ink);
    border-radius: 22px;
    transform: translateX(calc(100% + 30px));
  }

  .event-sheet.is-open,
  .collection-sheet.is-open {
    transform: translateX(0);
  }

  .sheet-handle {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
