html,
body,
#map {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  font-family: Roboto, Arial, sans-serif;
  overflow: hidden;
  /* no pinch or double-tap page zoom; the map handles its own gestures */
  touch-action: pan-x pan-y;
}

/* custom hand cursors (shapes from the Lucide icon set, ISC licence): filled ocean gradient,
   white edge, soft shadow. The numbers after each url are the click point. */
:root {
  --cursor-grab: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='-2 -1 28 28' stroke-linecap='round' stroke-linejoin='round'><defs><linearGradient id='g' gradientUnits='userSpaceOnUse' x1='0' y1='2' x2='0' y2='22'><stop offset='0' stop-color='%2314a3b8'/><stop offset='1' stop-color='%230b4f74'/></linearGradient><path id='p' d='M6 12H22V14A8 8 0 0 1 14 22H12C9.2 22 7.5 21.14 6.01 19.66Z'/><path id='f' d='M8 6V13M12 4V13M16 6V13M20 8V13M3.83 14.65L8.5 19.3' fill='none'/></defs><g transform='translate(.6 .9)' opacity='.25'><use href='%23p' fill='black' stroke='black' stroke-width='2'/><use href='%23f' stroke='black' stroke-width='5.2'/></g><use href='%23p' fill='white' stroke='white' stroke-width='2'/><use href='%23f' stroke='white' stroke-width='5.2'/><use href='%23p' fill='url(%23g)'/><use href='%23f' stroke='url(%23g)' stroke-width='3.1'/></svg>") 14 12, grab;
  --cursor-grabbing: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='-2 -1 28 28' stroke-linecap='round' stroke-linejoin='round'><defs><linearGradient id='g' gradientUnits='userSpaceOnUse' x1='0' y1='2' x2='0' y2='22'><stop offset='0' stop-color='%2314a3b8'/><stop offset='1' stop-color='%230b4f74'/></linearGradient><path id='p' d='M4 12H22V14A8 8 0 0 1 14 22H10A8 8 0 0 1 2 14Z'/><path id='f' d='M8 9V13M12 8V13M16 9V13M20 11V13M4 14V14.01' fill='none'/></defs><g transform='translate(.6 .9)' opacity='.25'><use href='%23p' fill='black' stroke='black' stroke-width='2'/><use href='%23f' stroke='black' stroke-width='5.2'/></g><use href='%23p' fill='white' stroke='white' stroke-width='2'/><use href='%23f' stroke='white' stroke-width='5.2'/><use href='%23p' fill='url(%23g)'/><use href='%23f' stroke='url(%23g)' stroke-width='3.1'/></svg>") 12 14, grabbing;
  --cursor-pointer: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='-2 -1 28 28' stroke-linecap='round' stroke-linejoin='round'><defs><linearGradient id='g' gradientUnits='userSpaceOnUse' x1='0' y1='2' x2='0' y2='22'><stop offset='0' stop-color='%2314a3b8'/><stop offset='1' stop-color='%230b4f74'/></linearGradient><path id='p' d='M6 12H22V14A8 8 0 0 1 14 22H12C9.2 22 7.5 21.14 6.01 19.66Z'/><path id='f' d='M8 4V13M12 9V13M16 10V13M20 11V13M3.83 14.65L8.5 19.3' fill='none'/></defs><g transform='translate(.6 .9)' opacity='.25'><use href='%23p' fill='black' stroke='black' stroke-width='2'/><use href='%23f' stroke='black' stroke-width='5.2'/></g><use href='%23p' fill='white' stroke='white' stroke-width='2'/><use href='%23f' stroke='white' stroke-width='5.2'/><use href='%23p' fill='url(%23g)'/><use href='%23f' stroke='url(%23g)' stroke-width='3.1'/></svg>") 8 2, pointer;
}

.leaflet-grab {
  cursor: var(--cursor-grab);
}

.leaflet-dragging .leaflet-grab,
.leaflet-dragging .leaflet-grab .leaflet-interactive,
.leaflet-dragging .leaflet-marker-draggable {
  cursor: var(--cursor-grabbing);
}

.leaflet-container .leaflet-interactive,
.leaflet-container a,
.leaflet-control-layers label,
button {
  cursor: var(--cursor-pointer);
}

/* layers control: round frosted button that opens into a small frosted panel */
.leaflet-control-layers,
.leaflet-touch .leaflet-control-layers {
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  background-clip: border-box;
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  box-shadow: 0 6px 20px rgba(4, 30, 50, 0.35);
  transition: background 0.2s;
}

.leaflet-control-layers:hover {
  background: rgba(255, 255, 255, 0.6);
}

.leaflet-control-layers-toggle,
.leaflet-touch .leaflet-control-layers-toggle,
.leaflet-retina .leaflet-control-layers-toggle {
  width: 40px;
  height: 40px;
  background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230b4f74' stroke-width='2' stroke-linejoin='round'><path d='M12 3 2 8.5 12 14l10-5.5z'/><path d='M2 12.5 12 18l10-5.5'/><path d='M2 16.5 12 22l10-5.5'/></svg>");
  background-size: 20px 20px;
}

.leaflet-control-layers-expanded {
  padding: 10px 14px 10px 12px;
  border-radius: 14px !important;
  background: rgba(255, 255, 255, 0.6) !important;
  color: #10303f;
  font: 13px/1.5 Roboto, Arial, sans-serif;
}

.leaflet-control-layers-expanded label {
  padding: 2px 0;
}

.leaflet-control-layers-selector {
  accent-color: #14a3b8;
  margin-right: 4px;
}

.leaflet-control-layers-separator {
  margin: 6px -14px 6px -12px;
  border-top-color: rgba(11, 79, 116, 0.2);
}

/* map credits: small faint label in the corner */
.leaflet-container .leaflet-control-attribution {
  padding: 1px 6px;
  border-top-left-radius: 6px;
  background: rgba(255, 255, 255, 0.35);
  color: rgba(16, 48, 63, 0.75);
  font: 9px/1.4 Roboto, Arial, sans-serif;
}

.leaflet-container .leaflet-control-attribution a {
  color: inherit;
  text-decoration: none;
}

/* search bar: frosted glass pill, matching the badge and popup */
.search {
  position: relative;
  width: 300px;
  max-width: calc(100vw - 20px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  box-shadow: 0 6px 20px rgba(4, 30, 50, 0.35);
  overflow: hidden;
  transition: background 0.2s, box-shadow 0.2s;
}

.search:focus-within {
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 6px 20px rgba(4, 30, 50, 0.35), 0 0 0 3px rgba(20, 163, 184, 0.45);
}

.search-icon {
  position: absolute;
  top: 12px;
  left: 14px;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: #0b4f74;
  stroke-width: 2.5;
  stroke-linecap: round;
  pointer-events: none;
}

.search input {
  box-sizing: border-box;
  width: 100%;
  padding: 11px 16px 11px 42px;
  border: 0;
  background: transparent;
  color: #10303f;
  font: 500 16px Roboto, Arial, sans-serif;
  outline: none;
}

.search input::placeholder {
  color: #2a6a80;
  opacity: 0.8;
}

.search ul {
  margin: 0;
  padding: 4px 6px 6px;
  list-style: none;
  border-top: 1px solid rgba(11, 79, 116, 0.15);
}

.search li {
  padding: 8px 12px;
  border-radius: 12px;
  color: #10303f;
  font-size: 14px;
  cursor: var(--cursor-pointer);
  transition: background 0.15s;
}

.search li:hover,
.search li.active {
  background: rgba(20, 163, 184, 0.18);
}

.search li.msg {
  color: #2a6a80;
  font-style: italic;
  cursor: default;
  background: none;
}

/* marker popups: frosted glass card with the spot name in the wordmark style */
.leaflet-popup-content-wrapper {
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  box-shadow: 0 6px 18px rgba(4, 30, 50, 0.35);
  color: #10303f;
  animation: popup-in 0.3s cubic-bezier(0.2, 1.2, 0.4, 1);
}

.leaflet-popup-tip {
  background: rgba(255, 255, 255, 0.55);
  box-shadow: none;
}

@keyframes popup-in {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.92);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.leaflet-popup-content {
  margin: 8px 12px;
  font-family: Roboto, Arial, sans-serif;
  line-height: 1.3;
  text-align: center;
}

.leaflet-popup-content h4 {
  margin: 0 0 4px;
  font: 18px/1 'Bebas Neue', Impact, sans-serif;
  letter-spacing: 0.05em;
  background: linear-gradient(90deg, #0b4f74, #14a3b8);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.leaflet-popup-content p {
  margin: 0;
  font-size: 11px;
}

/* rarity pill, coloured like the pin */
.leaflet-popup-content .tier {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.tier-free {
  background: #8a8f98;
  color: #fff;
}

.tier-basic {
  background: #2a7de1;
  color: #fff;
}

.tier-premium {
  background: #f5b400;
  color: #3a2a00;
}

.tier-secret {
  background: #3d1460;
  color: #fff;
}

/* welcome popup: frosted glass card over the map */
.popup {
  width: 440px;
  max-width: calc(100% - 32px);
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  box-shadow: 0 20px 60px rgba(4, 30, 50, 0.45);
}

.popup[open] {
  animation: welcome-in 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.popup::backdrop {
  background: linear-gradient(160deg, rgba(4, 30, 50, 0.55), rgba(6, 60, 90, 0.35));
  animation: backdrop-in 0.8s ease-out;
}

@keyframes welcome-in {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes backdrop-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.popup-x {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  color: #0b4f74;
  font-size: 24px;
  line-height: 1;
  cursor: var(--cursor-pointer);
  transition: background 0.2s;
}

.popup-x:hover {
  background: rgba(255, 255, 255, 0.85);
}

.popup-body {
  padding: 28px 28px 24px;
  color: #10303f;
  line-height: 1.55;
  text-align: center;
}

.popup-body h1 {
  margin: 0;
  font-weight: normal;
  line-height: 1;
}

.welcome-kicker {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: #2a7d96;
}

/* WaveFinder wordmark, used in the popup and the top-left badge */
.wordmark {
  display: block;
  font: 56px 'Bebas Neue', Impact, sans-serif;
  letter-spacing: 0.04em;
  background: linear-gradient(90deg, #0b4f74, #14a3b8 55%, #0b4f74);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* top left on desktop: badge with the menu button underneath. On phones the badge is
   centred and the menu moves to the right-hand column (see the narrow-screen rules below) */
.topbar {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  pointer-events: none;
}

.brand {
  padding: 6px 28px 2px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  box-shadow: 0 6px 20px rgba(4, 30, 50, 0.35);
  pointer-events: none;
}

.brand .wordmark {
  font-size: 38px;
  line-height: 1;
  letter-spacing: 0.08em;
}

/* round frosted info button under the search bar */
.glass-button {
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  box-shadow: 0 6px 20px rgba(4, 30, 50, 0.35);
  color: #0b4f74;
  font: 700 20px Georgia, serif;
  font-style: italic;
  cursor: var(--cursor-pointer);
  transition: transform 0.2s, background 0.2s;
}

.glass-button:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.6);
}

/* menu: round button that expands into the panel (rightwards under the badge on desktop,
   leftwards from the right-hand column on phones) */
.menu {
  position: relative;
  pointer-events: auto;
}

#menu-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  box-shadow: 0 6px 20px rgba(4, 30, 50, 0.35);
  color: #0b4f74;
  transition: background 0.2s, transform 0.2s;
}

#menu-toggle:hover {
  background: rgba(255, 255, 255, 0.6);
  transform: translateY(-2px);
}

#menu-toggle[aria-expanded="true"] {
  visibility: hidden;
}

#menu-toggle svg,
#menu-back svg {
  width: 16px;
  height: 16px;
}

#menu-toggle svg,
#menu-back svg,
.menu-state svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.menu-state svg {
  width: 18px;
  height: 18px;
}

/* the menu button expands into this panel (a circle growing out from the button) */
#menu-panel {
  --origin: 20px 20px; /* centre of the menu button */
  position: absolute;
  top: 0;
  left: 0;
  width: 260px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  box-shadow: 0 12px 32px rgba(4, 30, 50, 0.4);
  animation: menu-expand 0.45s cubic-bezier(0.3, 0.9, 0.3, 1);
}

#menu-panel.closing {
  animation: menu-collapse 0.6s ease-in-out forwards;
}

#menu-panel[hidden] {
  display: none;
}

@keyframes menu-expand {
  from {
    clip-path: circle(20px at var(--origin));
  }
  to {
    clip-path: circle(150% at var(--origin));
  }
}

@keyframes menu-collapse {
  from {
    clip-path: circle(150% at var(--origin));
    opacity: 1;
  }
  to {
    clip-path: circle(20px at var(--origin));
    opacity: 0;
  }
}

/* back button sits exactly where the menu button was */
#menu-back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin: -1px 0 0 -1px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  color: #0b4f74;
  transition: background 0.2s, transform 0.2s;
}

/* phones: the button is in the bottom-right corner, so the panel opens up and to the left,
   with the back button (and info/account) along the bottom where the menu button was */
.menu.in-column #menu-panel {
  --origin: calc(100% - 20px) calc(100% - 20px);
  top: auto;
  bottom: 0;
  left: auto;
  right: 0;
  display: flex;
  flex-direction: column-reverse;
}

.menu.in-column #menu-panel[hidden] {
  display: none;
}

.menu.in-column #menu-back {
  align-self: flex-end;
  margin: 0 -1px -1px 0;
}

/* info and account buttons at the top of the menu: phones only */
.menu-actions {
  display: none;
}

.menu.in-column .menu-actions {
  position: absolute;
  bottom: 6px;
  left: 50%;
  display: flex;
  gap: 12px;
  transform: translateX(-50%);
}

@media (max-width: 640px) {
  .leaflet-control.info-button,
  .leaflet-control.account-button {
    display: none;
  }
}

#menu-back:hover {
  background: rgba(255, 255, 255, 0.6);
  transform: translateX(-2px);
}

#menu-states {
  padding: 4px 6px 6px;
}

@keyframes menu-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.menu-state {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 11px 14px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #0b4f74;
  font: 600 13px Roboto, Arial, sans-serif;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: background 0.15s;
}

.menu-state:hover,
.menu-state[aria-expanded="true"] {
  background: rgba(20, 163, 184, 0.18);
}

.menu-state svg {
  transition: transform 0.2s;
}

.menu-state[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

/* each state's suburbs scroll inside their own area (New South Wales is the long one) */
.menu-suburbs {
  max-height: 240px;
  margin: 4px 0 6px 16px;
  padding: 0 6px 0 10px;
  overflow-y: auto;
  overscroll-behavior: contain;
  list-style: none;
  border-left: 2px solid rgba(20, 163, 184, 0.5);
  animation: menu-in 0.2s ease-out;
  scrollbar-width: thin;
  scrollbar-color: rgba(11, 79, 116, 0.55) transparent;
}

.menu-suburbs::-webkit-scrollbar {
  width: 6px;
}

.menu-suburbs::-webkit-scrollbar-track {
  margin: 4px 0;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.25);
}

.menu-suburbs::-webkit-scrollbar-thumb {
  border-radius: 3px;
  background: linear-gradient(#14a3b8, #0b4f74);
}

.menu-suburbs::-webkit-scrollbar-thumb:hover {
  background: #0b4f74;
}

.menu-suburbs[hidden] {
  display: none;
}

.menu-suburb {
  width: 100%;
  padding: 7px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #10303f;
  font: 15px Roboto, Arial, sans-serif;
  text-align: left;
  transition: background 0.15s, padding-left 0.15s;
}

.menu-suburb:hover {
  padding-left: 14px;
  background: rgba(255, 255, 255, 0.6);
}

/* narrow screens: centred smaller badge, search collapses to a button */
@media (max-width: 640px) {
  .topbar {
    left: 50%;
    transform: translateX(-50%);
  }

  .brand {
    padding: 5px 18px 1px;
  }

  .brand .wordmark {
    font-size: 30px;
  }

  .leaflet-top.leaflet-right {
    top: 56px;
  }

  /* search collapses to a round button (bottom right) and expands when tapped;
     suggestions open upwards, above the bar */
  .search {
    display: flex;
    flex-direction: column-reverse;
    width: calc(100vw - 20px);
    transition: width 0.3s ease, background 0.2s, box-shadow 0.2s;
  }

  .search-icon {
    top: auto;
    bottom: 12px;
  }

  .search ul {
    border-top: 0;
    border-bottom: 1px solid rgba(11, 79, 116, 0.15);
  }

  .search:not(.open) {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
    cursor: var(--cursor-pointer);
  }

  .search:not(.open) .search-icon {
    bottom: 11px;
    left: 10px;
  }

  .search:not(.open) input,
  .search:not(.open) ul {
    visibility: hidden;
  }
}

.welcome-wave {
  display: block;
  width: 120px;
  height: 12px;
  margin: 8px auto 18px;
  fill: none;
  stroke: #14a3b8;
  stroke-width: 2.5;
  stroke-linecap: round;
}

.popup-body p {
  margin: 0 0 10px;
}

.popup-body h2 {
  margin: 22px 0 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #2a7d96;
}

.legend {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  text-align: left;
}

.legend li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.45);
}

.legend strong {
  min-width: 52px;
}

.popup-button {
  width: 100%;
  margin-top: 22px;
  padding: 14px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #0b4f74, #14a3b8);
  color: #fff;
  font: 600 16px Roboto, Arial, sans-serif;
  letter-spacing: 0.05em;
  cursor: var(--cursor-pointer);
  box-shadow: 0 6px 18px rgba(11, 79, 116, 0.35);
  transition: transform 0.2s, box-shadow 0.2s;
}

.popup-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(11, 79, 116, 0.45);
}

@media (prefers-reduced-motion: reduce) {
  .popup[open],
  .popup::backdrop {
    animation: none;
  }
}

/* bottom-left panel showing which pin colours are on the map */
.tier-indicator {
  display: flex;
  gap: 4px;
  padding: 5px 8px 2px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  box-shadow: 0 6px 20px rgba(4, 30, 50, 0.35);
  animation: pin-fade-in 0.9s ease-out;
}

.tier-indicator[hidden],
.tier-indicator [hidden] {
  display: none;
}

/* hover label above each pin, e.g. "Rare Spots Displayed" */
.tier-indicator .pin {
  position: relative;
}

.tier-indicator svg {
  width: 14px;
  height: 21px;
}

.tier-indicator .pin::after {
  content: attr(data-label);
  position: absolute;
  bottom: calc(100% + 8px);
  left: -8px;
  padding: 4px 8px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 7px;
  background: rgba(8, 52, 78, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 6px 18px rgba(4, 30, 50, 0.4);
  color: #fff;
  font: 600 11px Roboto, Arial, sans-serif;
  letter-spacing: 0.04em;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}

.tier-indicator .pin:hover::after {
  opacity: 1;
  transform: none;
}

/* phones: no per-pin labels; tapping the panel shows one combined label instead */
@media (max-width: 640px) {
  .tier-indicator .pin::after {
    display: none;
  }

  .tier-indicator {
    cursor: var(--cursor-pointer);
  }

  .tier-indicator::after {
    content: attr(data-label);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    padding: 4px 8px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 7px;
    background: rgba(8, 52, 78, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 6px 18px rgba(4, 30, 50, 0.4);
    color: #fff;
    font: 600 11px Roboto, Arial, sans-serif;
    letter-spacing: 0.04em;
    white-space: nowrap;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.2s, transform 0.2s;
    pointer-events: none;
  }

  .tier-indicator.show-label::after {
    opacity: 1;
    transform: none;
  }
}

/* small legal links at the bottom of popups */
.popup-legal {
  margin: 14px 0 0 !important;
  font-size: 12px;
  color: #2a6a80;
}

.popup-legal a {
  color: #0b4f74;
}

/* "Continue with Google" button and the divider under it */
.google-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  margin-top: 4px;
  padding: 12px;
  border: 1px solid rgba(11, 79, 116, 0.2);
  border-radius: 999px;
  background: #fff;
  color: #1f1f1f;
  font: 600 15px Roboto, Arial, sans-serif;
  box-shadow: 0 4px 12px rgba(4, 30, 50, 0.15);
  transition: transform 0.2s, box-shadow 0.2s;
}

.google-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(4, 30, 50, 0.22);
}

.google-button svg {
  width: 20px;
  height: 20px;
}

.or-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 2px !important;
  color: #2a6a80;
  font-size: 12px;
  letter-spacing: 0.06em;
}

.or-divider::before,
.or-divider::after {
  content: '';
  flex: 1;
  border-top: 1px solid rgba(11, 79, 116, 0.2);
}

/* login popup */
#login .wordmark {
  font-size: 40px;
}

.field {
  display: block;
  margin: 12px 0 0;
  text-align: left;
}

.field span {
  display: block;
  margin: 0 0 4px 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #2a7d96;
}

.field input {
  box-sizing: border-box;
  width: 100%;
  padding: 11px 14px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.5);
  color: #10303f;
  font: 16px Roboto, Arial, sans-serif;
  outline: none;
  transition: background 0.2s, box-shadow 0.2s;
}

.field input:focus {
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 0 0 3px rgba(20, 163, 184, 0.45);
}

.login-note {
  margin: 14px 0 0 !important;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(20, 163, 184, 0.18);
  color: #0b4f74;
  font-size: 13px;
}

.login-note[hidden],
#login [hidden] {
  display: none;
}

.login-note.error {
  background: rgba(200, 40, 40, 0.15);
  color: #8a1c1c;
}

/* plan picker on the sign-up form */
.plans {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 4px 0 0;
  padding: 0;
  border: 0;
}

/* the popup heading already says "Choose your plan"; keep the legend for screen readers only */
.plans legend {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.plan input {
  position: absolute;
  opacity: 0;
}

.plan-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  height: 100%;
  box-sizing: border-box;
  padding: 10px 6px;
  border: 2px solid rgba(255, 255, 255, 0.6);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.4);
  cursor: var(--cursor-pointer);
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.plan-card:hover {
  background: rgba(255, 255, 255, 0.65);
  transform: translateY(-2px);
}

.plan input:checked + .plan-card {
  border-color: #14a3b8;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 4px 14px rgba(11, 79, 116, 0.25);
}

.plan input:focus-visible + .plan-card {
  box-shadow: 0 0 0 3px rgba(20, 163, 184, 0.45);
}

.plan-pins {
  display: flex;
  gap: 1px;
  height: 21px;
}

.plan-pins svg {
  width: 14px;
  height: 21px;
}

.plan-card strong {
  font-size: 13px;
  line-height: 1.2;
}

.plan-price {
  font: 20px/1 'Bebas Neue', Impact, sans-serif;
  letter-spacing: 0.04em;
  color: #0b4f74;
}

.plan-desc {
  font-size: 11px;
  line-height: 1.3;
  color: #2a6a80;
}

@media (max-width: 420px) {
  .plans {
    grid-template-columns: 1fr;
  }
}

#account-view p {
  margin: 0 0 8px;
}

/* Your details summary: label / value rows */
.summary {
  margin: 0;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.4);
  overflow: hidden;
  text-align: left;
}

.summary > div {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 12px;
  padding: 10px 14px;
}

.summary > div + div {
  border-top: 1px solid rgba(11, 79, 116, 0.12);
}

.summary dt {
  color: #2a7d96;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1.9;
  text-transform: uppercase;
}

.summary dd {
  margin: 0;
  color: #10303f;
  font-size: 15px;
  overflow-wrap: anywhere;
}

.summary dd.unset {
  color: #5d8796;
  font-style: italic;
}

/* plan row stands out */
#summary-plan {
  color: #0b4f74;
  font-weight: 700;
}

#summary-note {
  margin-top: 12px !important;
}

/* Your details form */
.field-row {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 10px;
}

/* custom dropdown (gender): frosted button like the text fields, opening a frosted list */
.select {
  position: relative;
}

.select-button {
  box-sizing: border-box;
  width: 100%;
  padding: 11px 40px 11px 14px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.5)
    url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230b4f74' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><path d='M6 9l6 6 6-6'/></svg>")
    no-repeat right 14px center / 16px 16px;
  color: #10303f;
  font: 16px Roboto, Arial, sans-serif;
  text-align: left;
  transition: background-color 0.2s, box-shadow 0.2s;
}

.select-button[aria-expanded="true"] {
  background-color: rgba(255, 255, 255, 0.8);
  box-shadow: 0 0 0 3px rgba(20, 163, 184, 0.45);
}

/* (overrides the small uppercase .field heading style) */
.field .select-value {
  display: inline;
  margin: 0;
  color: #10303f;
  font-size: 16px;
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
}

/* "Choose…" shows faded until something is picked */
.select.empty .select-value {
  color: #5d8796;
}

.select-list {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 5;
  margin: 0;
  padding: 6px;
  list-style: none;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 14px;
  background: rgba(240, 248, 250, 0.92);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  box-shadow: 0 12px 28px rgba(4, 30, 50, 0.35);
  outline: none;
  animation: menu-in 0.15s ease-out;
}

.select-list[hidden] {
  display: none;
}

.select-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-radius: 10px;
  color: #10303f;
  font-size: 15px;
  text-align: left;
  cursor: var(--cursor-pointer);
}

.select-list li.active {
  background: rgba(20, 163, 184, 0.18);
}

.select-list li[aria-selected="true"] {
  color: #0b4f74;
  font-weight: 600;
}

.select-list li[aria-selected="true"]::after {
  content: '';
  width: 16px;
  height: 16px;
  background: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2314a3b8' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><path d='M5 12.5l4.5 4.5L19 7'/></svg>") center / contain no-repeat;
}

/* hover and focus for everything in the account popup */
#login .field input:hover,
#login .select-button:hover {
  background-color: rgba(255, 255, 255, 0.65);
}

#login .field input:focus,
#login .select-button:focus-visible {
  background-color: rgba(255, 255, 255, 0.8);
  box-shadow: 0 0 0 3px rgba(20, 163, 184, 0.45);
  outline: none;
}

#login button:focus-visible,
#login a:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(20, 163, 184, 0.55);
}

#login .popup-button.danger:hover {
  filter: brightness(1.08);
}

#login .login-alt a,
#login .popup-legal a,
#login .link-button {
  transition: color 0.15s;
}

#login .login-alt a:hover,
#login .popup-legal a:hover,
#login .link-button:hover {
  color: #14a3b8;
}

#login .chip span:hover {
  background: rgba(255, 255, 255, 0.7);
}

#login .chip input:checked + span:hover {
  background: rgba(20, 163, 184, 0.28);
}

/* surfing preference tick boxes, shown as chips */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  border: 0;
}

.chips legend {
  width: 100%;
  margin: 0 0 6px 4px;
  padding: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #2a7d96;
}

.chips legend small {
  font-weight: 400;
  letter-spacing: 0.05em;
  text-transform: none;
}

.chip {
  position: relative;
}

.chip input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
}

/* (overrides the small uppercase .field heading style) */
.chip span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 8px 14px;
  font-weight: 500;
  letter-spacing: normal;
  text-transform: none;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.45);
  color: #10303f;
  font-size: 14px;
  cursor: var(--cursor-pointer);
  transition: background 0.15s, border-color 0.15s;
}

.chip span::before {
  content: '';
  width: 14px;
  height: 14px;
  border: 2px solid #2a7d96;
  border-radius: 4px;
  box-sizing: border-box;
}

.chip input:checked + span {
  border-color: #14a3b8;
  background: rgba(20, 163, 184, 0.2);
}

.chip input:checked + span::before {
  border-color: #0b4f74;
  background: #0b4f74 url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'><path d='M2.5 6.2l2.3 2.3 4.7-5' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>") center / 10px no-repeat;
}

.chip input:focus-visible + span {
  box-shadow: 0 0 0 3px rgba(20, 163, 184, 0.45);
}

/* ===== admin panel (admins only): side panel on desktop, bottom sheet on phones ===== */
.admin-panel {
  position: fixed;
  top: 10px;
  bottom: 10px;
  left: 10px;
  z-index: 1100;
  box-sizing: border-box;
  width: 360px;
  max-width: calc(100vw - 20px);
  padding: 16px 18px 18px;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  box-shadow: 0 20px 60px rgba(4, 30, 50, 0.45);
  color: #10303f;
  animation: menu-in 0.25s ease-out;
}

.admin-panel[hidden],
.admin-panel [hidden] {
  display: none;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.admin-header .wordmark {
  margin: 0;
  font-size: 32px;
}

.admin-header .popup-x {
  position: static;
}

.admin-search {
  box-sizing: border-box;
  width: 100%;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.6);
  color: #10303f;
  font: 15px Roboto, Arial, sans-serif;
  outline: none;
}

.admin-search:focus {
  box-shadow: 0 0 0 3px rgba(20, 163, 184, 0.45);
}

.admin-panel #admin-add {
  margin-top: 10px;
}

.admin-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 2px 0;
  color: #10303f;
  font-size: 13px;
  cursor: var(--cursor-pointer);
}

.admin-toggle input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #14a3b8;
}

/* archived spots in the list are faded */
.admin-list li.archived button {
  opacity: 0.55;
}

.admin-list li.archived .admin-name {
  text-decoration: line-through;
}

.admin-count {
  margin: 12px 2px 6px;
  color: #2a6a80;
  font-size: 12px;
}

.admin-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.admin-list button {
  display: grid;
  grid-template-columns: 12px 1fr;
  column-gap: 10px;
  align-items: center;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #10303f;
  text-align: left;
  font: 14px Roboto, Arial, sans-serif;
  transition: background 0.15s;
}

.admin-list button:hover,
.admin-list button:focus-visible {
  background: rgba(20, 163, 184, 0.16);
  outline: none;
}

.admin-list small {
  grid-column: 2;
  color: #5d8796;
  font-size: 11px;
}

.tier-dot {
  grid-row: span 2;
  width: 12px;
  height: 12px;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(11, 79, 116, 0.25);
}

.admin-back {
  margin: 0 0 4px -8px;
  text-decoration: none;
}

.admin-form-title {
  margin: 4px 0 0;
  font: 24px/1.1 'Bebas Neue', Impact, sans-serif;
  letter-spacing: 0.04em;
  color: #0b4f74;
}

.admin-id {
  margin: 2px 0 4px;
  color: #5d8796;
  font-size: 12px;
}

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

.admin-panel .popup-button {
  margin-top: 12px;
}

.admin-hint {
  margin: 6px 2px 0;
  color: #5d8796;
  font-size: 12px;
}

.admin-panel .login-note {
  margin: 12px 0 0;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(20, 163, 184, 0.18);
  color: #0b4f74;
  font-size: 13px;
}

.admin-panel .login-note.error {
  background: rgba(200, 40, 40, 0.15);
  color: #8a1c1c;
}

/* state and rarity chips are single-choice: round ticks */
.chip input[type="radio"] + span::before {
  border-radius: 50%;
}

/* rarity chips carry their pin colour */
.tier-chip span::before {
  border-color: transparent;
}

.tier-chip.free span::before,
.tier-chip.free input:checked + span::before { background: #8a8f98; }
.tier-chip.basic span::before,
.tier-chip.basic input:checked + span::before { background: #2a7de1; }
.tier-chip.premium span::before,
.tier-chip.premium input:checked + span::before { background: #f5b400; }
.tier-chip.secret span::before,
.tier-chip.secret input:checked + span::before { background: #3d1460; }

.tier-chip input:checked + span::before {
  border-color: #fff;
  box-shadow: 0 0 0 2px #0b4f74;
}

/* the draggable pin used while editing a spot */
.edit-pin {
  box-sizing: border-box;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #ff6b00;
  box-shadow: 0 0 0 4px rgba(255, 107, 0, 0.35), 0 4px 10px rgba(0, 0, 0, 0.4);
  cursor: move;
}

/* choosing a location on the map */
#map.picking,
#map.picking .leaflet-grab {
  cursor: crosshair;
}

@media (max-width: 640px) {
  .admin-panel {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: none;
    max-height: 65vh;
    border-radius: 20px 20px 0 0;
  }
}

/* payment success window: animated tick */
.success-tick {
  display: block;
  width: 64px;
  height: 64px;
  margin: 4px auto 10px;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.success-tick circle {
  fill: rgba(20, 163, 184, 0.15);
  stroke: #14a3b8;
  stroke-width: 3;
}

.success-tick path {
  stroke: #0b4f74;
  stroke-width: 4;
  stroke-dasharray: 40;
  stroke-dashoffset: 40;
  animation: tick-draw 0.6s 0.3s ease-out forwards;
}

@keyframes tick-draw {
  to {
    stroke-dashoffset: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .success-tick path {
    stroke-dashoffset: 0;
    animation: none;
  }
}

.success-status {
  margin: 0 0 4px !important;
  color: #2a6a80;
  font-size: 14px;
}

/* cancel subscription: red tint so it reads as a serious action */
.manage-option.danger strong,
.manage-option.danger svg {
  color: #a32020;
  stroke: #a32020;
}

.popup-button.danger {
  background: linear-gradient(90deg, #8f1d1d, #c0392b);
  box-shadow: 0 6px 18px rgba(143, 29, 29, 0.35);
}

.cancel-points {
  margin: 0 0 6px;
  padding-left: 20px;
  text-align: left;
}

.cancel-points li {
  margin-bottom: 6px;
}

/* Admin Mode button: see-through Secret-spot purple */
.popup-button.admin-mode {
  margin-top: 10px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(61, 20, 96, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 6px 18px rgba(61, 20, 96, 0.3);
  color: #fff;
}

.popup-button.admin-mode:hover {
  background: rgba(61, 20, 96, 0.75);
  box-shadow: 0 10px 24px rgba(61, 20, 96, 0.4);
}

.popup-button.secondary {
  margin-top: 10px;
  background: rgba(255, 255, 255, 0.5);
  color: #0b4f74;
  box-shadow: none;
}

.popup-button.secondary:hover {
  background: rgba(255, 255, 255, 0.75);
  box-shadow: none;
}

/* manage account options */
.manage-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  margin: 0 0 8px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.45);
  color: #10303f;
  text-align: left;
  transition: background 0.2s, transform 0.2s;
}

.manage-option:hover {
  background: rgba(255, 255, 255, 0.75);
  transform: translateX(2px);
}

.manage-option span {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.manage-option strong {
  font: 600 15px Roboto, Arial, sans-serif;
}

.manage-option small {
  font-size: 12px;
  color: #2a6a80;
}

.manage-option svg {
  flex: none;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: #0b4f74;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* account button under the info button */
.account-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
}

.account-button.signed-in {
  background: linear-gradient(135deg, #0b4f74, #14a3b8);
  color: #fff;
}

.login-alt {
  margin: 14px 0 0 !important;
  font-size: 13px;
}

.login-alt a {
  color: #0b4f74;
  font-weight: 700;
}

.link-button {
  margin-top: 6px;
  padding: 4px 8px;
  border: 0;
  background: none;
  color: #2a6a80;
  font: 13px Roboto, Arial, sans-serif;
  text-decoration: underline;
}

/* nearest-beach dot from search */
.beach-dot {
  box-sizing: border-box;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #ff6b00;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

/* tier-coloured spot pins, fading in and out (0.9s matches FADE_MS in app.js) */
.pin svg {
  animation: pin-fade-in 0.9s ease-out;
}

.pin.leaving {
  pointer-events: none;
}

.pin.leaving svg {
  animation: pin-fade-out 0.9s ease-in forwards;
}

@keyframes pin-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes pin-fade-out {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

.pin path {
  stroke: #fff;
  stroke-width: 1.5;
}

.pin circle {
  fill: #fff;
}

.pin-free path {
  fill: #8a8f98;
}

.pin-basic path {
  fill: #2a7de1;
}

.pin-premium path {
  fill: #f5b400;
}

.pin-secret path {
  fill: #3d1460;
}
