:root {
  color-scheme: light;
  --ink: #17232b;
  --muted: #617179;
  --paper: #fff8e7;
  --cream: #fffdf5;
  --teal: #0f6f78;
  --teal-dark: #094951;
  --coral: #e85d3f;
  --gold: #f4b63f;
  --park: #4a7c59;
  --water: #2b6cb0;
  --coast: #c05621;
  --desert: #7b4fa1;
  --barrio: #d33682;
  --shadow: 0 18px 48px rgba(19, 35, 43, 0.2);
  --radius: 8px;
  font-family: ui-rounded, "Nunito", "Avenir Next", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--teal-dark);
  color: var(--ink);
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

.screen {
  display: none;
  min-height: 100vh;
}

.screen.is-active {
  display: block;
}

.splash {
  position: relative;
  overflow: hidden;
  padding: 18px;
  background:
    linear-gradient(160deg, rgba(9, 73, 81, 0.92), rgba(15, 111, 120, 0.78)),
    url("./../public/assets/locations-map.png") center / cover;
  color: white;
}

.splash__art {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 10px auto 18px;
  max-width: 540px;
}

.splash__art img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border: 3px solid rgba(255, 255, 255, 0.85);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.splash__content {
  max-width: 560px;
  margin: 0 auto;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
  line-height: 0.98;
}

h1 {
  max-width: 8ch;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.85rem, 14.5vw, 5.4rem);
  overflow-wrap: normal;
}

h2 {
  font-size: 1.55rem;
}

.lede {
  margin: 14px 0 8px;
  max-width: 28ch;
  color: #fff1b9;
  font-size: 1.08rem;
  font-weight: 900;
  line-height: 1.18;
}

.summary {
  margin: 0 0 18px;
  max-width: 34ch;
  color: rgba(255, 255, 255, 0.86);
  font-size: 1rem;
}

.splash-status {
  min-height: 1.3em;
  margin: 0 0 10px;
  color: #fff1b9;
  font-size: 0.9rem;
  font-weight: 800;
}

.admin-link {
  display: inline-flex;
  margin-top: 14px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.76rem;
  font-weight: 800;
  text-decoration: none;
}

.admin-link:hover {
  color: white;
}

.mode-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.mode-grid--single {
  grid-template-columns: minmax(0, 1fr);
}

.mode-card {
  display: grid;
  min-width: 0;
  min-height: 154px;
  padding: 12px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.12);
  color: white;
  text-align: left;
  backdrop-filter: blur(12px);
}

.mode-card img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 50%;
  background: white;
}

.mode-card span {
  align-self: end;
  font-size: 1.05rem;
  font-weight: 900;
}

.mode-card small {
  color: rgba(255, 255, 255, 0.75);
}

.primary-button,
.secondary-button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--radius);
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
}

.primary-button {
  width: 100%;
  background: var(--gold);
  color: #291702;
  box-shadow: 0 8px 0 rgba(41, 23, 2, 0.18);
}

.secondary-button {
  background: #e7f4f0;
  color: var(--teal-dark);
}

.icon-button {
  min-width: 48px;
  min-height: 44px;
  padding: 0 9px;
  border: 2px solid transparent;
  color: white;
  font-size: 0.72rem;
  box-shadow: 0 5px 0 rgba(23, 35, 43, 0.14);
}

.icon-button[data-state="on"] {
  background: var(--teal);
}

.icon-button[data-state="off"] {
  background: var(--coral);
}

.feedback-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  margin-bottom: 10px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--radius);
  background: #e7f4f0;
  color: var(--teal-dark);
  font-weight: 900;
  text-decoration: none;
  box-shadow: 0 8px 0 rgba(9, 73, 81, 0.18);
}

.feedback-button--topbar {
  min-height: 44px;
  margin-bottom: 0;
  background: var(--gold);
  color: #291702;
  box-shadow: 0 5px 0 rgba(41, 23, 2, 0.16);
}

.hunt {
  position: relative;
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
  background: #d7efe6;
}

.topbar {
  position: absolute;
  z-index: 50;
  top: 10px;
  right: 10px;
  left: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border-radius: var(--radius);
  background: rgba(255, 253, 245, 0.92);
  box-shadow: 0 8px 22px rgba(15, 73, 81, 0.16);
}

.topbar h2 {
  font-size: 1.15rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar > div:first-child {
  flex: 1;
  min-width: 0;
}

.topbar__actions {
  flex-shrink: 0;
}

.topbar .eyebrow {
  margin-bottom: 2px;
  color: var(--coral);
}

.topbar__actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.map-shell,
#map,
.map-fallback {
  position: absolute;
  inset: 0;
}

#map {
  z-index: 1;
  transition: transform 0.8s ease, filter 0.8s ease;
  transform-origin: 50% 66%;
}

.hunt.is-routing #map {
  transform: perspective(850px) rotateX(48deg) scale(1.34);
  filter: saturate(1.08) contrast(1.04);
}

.hunt.is-routing .leaflet-control-zoom {
  display: none;
}

.map-fallback {
  z-index: 2;
  display: grid;
  place-items: center;
  background: #e6f3ed;
}

.map-fallback img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.route-pulse {
  position: absolute;
  z-index: 70;
  inset: 0;
  display: grid;
  align-items: end;
  padding: 12px 12px 118px;
  background: linear-gradient(to bottom, rgba(9, 73, 81, 0.06), rgba(9, 73, 81, 0.42));
  pointer-events: none;
}

.route-narration {
  position: relative;
  width: min(100%, 640px);
  margin: 0 auto;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  background: rgba(23, 35, 43, 0.92);
  color: white;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  pointer-events: auto;
}

.route-cancel {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 2px solid rgba(255, 255, 255, 0.82);
  border-radius: 50%;
  background: #d92d20;
  color: white;
  font-size: 1.38rem;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.route-narration .eyebrow {
  margin-bottom: 4px;
  padding-right: 42px;
}

.route-narration strong {
  display: block;
  font-size: 1.05rem;
  line-height: 1.15;
}

#routeDistance {
  margin: 5px 0 10px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.82rem;
  font-weight: 800;
}

.route-caption {
  margin: 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: 1rem;
  line-height: 1.45;
}

.route-caption span {
  display: inline-block;
  margin-right: 0.15em;
  padding: 0 2px;
  border-radius: 4px;
}

.route-caption .is-spoken {
  background: var(--gold);
  color: #291702;
  font-weight: 900;
}

.status-banner {
  position: absolute;
  z-index: 72;
  top: 88px;
  right: 12px;
  left: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(43, 108, 176, 0.26);
  border-radius: var(--radius);
  background: rgba(23, 35, 43, 0.9);
  color: #cde7ff;
  font-size: 0.85rem;
  font-weight: 800;
  text-align: center;
  box-shadow: 0 8px 22px rgba(15, 73, 81, 0.16);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s ease;
  pointer-events: none;
}

.status-banner.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.progress-panel {
  position: absolute;
  z-index: 55;
  right: 10px;
  bottom: 124px;
  left: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border-radius: var(--radius);
  background: rgba(255, 253, 245, 0.94);
  box-shadow: 0 8px 22px rgba(15, 73, 81, 0.16);
}

.progress-panel strong,
.progress-panel span {
  display: block;
}

.progress-panel strong {
  font-size: 1.3rem;
}

.progress-panel span {
  color: var(--muted);
  font-size: 0.82rem;
}

.set-progress {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: stretch;
  min-width: min(58vw, 250px);
}

.set-progress__button {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto;
  gap: 7px;
  align-items: center;
  min-height: 34px;
  padding: 5px 8px;
  border: 1px solid rgba(15, 111, 120, 0.16);
  border-radius: var(--radius);
  background: rgba(231, 244, 240, 0.72);
  color: var(--ink);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.set-progress__label {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.78rem;
  line-height: 1.05;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.set-progress__button span:last-child {
  color: var(--ink);
  font-size: 0.72rem;
  white-space: nowrap;
}

.dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.dot--park { background: var(--park); }
.dot--water { background: var(--water); }
.dot--coast { background: var(--coast); }
.dot--desert { background: var(--desert); }
.dot--barrio { background: var(--barrio); }

.treasure-rail {
  position: absolute;
  z-index: 55;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 0 10px 12px;
  overflow-x: auto;
}

#treasureRail {
  display: flex;
  gap: 10px;
  min-width: max-content;
}

.rail-card {
  width: 190px;
  min-height: 100px;
  padding: 10px;
  border: 0;
  border-radius: var(--radius);
  background: var(--cream);
  box-shadow: 0 8px 22px rgba(15, 73, 81, 0.16);
  text-align: left;
}

.rail-card strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
}

.rail-card small {
  color: var(--muted);
}

.rail-card.is-collected {
  outline: 3px solid var(--gold);
}

.sheet,
.collection-sheet,
.reward,
.feedback {
  position: fixed;
  z-index: 100;
  inset: 0;
}

.sheet,
.collection-sheet {
  display: none;
  align-items: end;
  padding: 12px;
  background: rgba(9, 73, 81, 0.38);
  overflow-x: hidden;
}

.sheet.is-open,
.collection-sheet.is-open {
  display: flex;
}

.sheet__close {
  position: absolute;
  z-index: 4;
  top: 18px;
  right: 18px;
  min-height: 38px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--radius);
  background: rgba(23, 35, 43, 0.82);
  color: white;
  font-weight: 900;
}

.flip-card {
  width: 100%;
  max-width: 560px;
  height: min(78vh, 650px);
  margin: 0 auto;
  perspective: 1200px;
}

.collection-panel {
  position: relative;
  width: min(100%, 620px);
  max-width: 620px;
  max-height: 82vh;
  margin: 0 auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 18px;
  border-radius: var(--radius);
  background: var(--cream);
  box-shadow: var(--shadow);
}

.collection-panel > .sheet__close {
  position: static;
  display: flex;
  width: 100%;
  margin: 0 0 12px;
  background: var(--ink);
}

.collection-summary {
  margin: 8px 0 16px;
  color: var(--muted);
  font-weight: 800;
}

#collectionTitle {
  max-width: 18ch;
  font-size: 1.32rem;
  line-height: 1.08;
}

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

.collection-card {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 8px;
  border: 2px solid transparent;
  border-radius: var(--radius);
  background: #f3efe0;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  overflow: hidden;
}

.collection-card.is-collected {
  border-color: var(--gold);
  background: #fff7d4;
}

.collection-card__image {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #d7efe6, #ffe1a6);
}

.collection-card__image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.collection-card__status {
  position: absolute;
  top: 6px;
  right: 6px;
  min-width: 34px;
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(23, 35, 43, 0.84);
  color: white;
  font-size: 0.72rem;
  font-weight: 900;
  text-align: center;
}

.collection-card__body {
  display: block;
  min-width: 0;
}

.collection-card.is-collected .collection-card__status {
  background: var(--gold);
  color: #291702;
}

.collection-card strong {
  display: block;
  font-size: 0.92rem;
  line-height: 1.16;
  overflow-wrap: anywhere;
}

.collection-card small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.78rem;
}

.flip-card__inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.55s ease;
  transform-style: preserve-3d;
}

.flip-card.is-flipped .flip-card__inner {
  transform: rotateY(180deg);
}

.flip-card__face {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  padding: 18px;
  border-radius: var(--radius);
  background: var(--cream);
  box-shadow: var(--shadow);
  backface-visibility: hidden;
}

.card-back {
  transform: rotateY(180deg);
}

.card-image-wrap {
  display: grid;
  place-items: center;
  height: 46%;
  min-height: 230px;
  margin-bottom: 14px;
  overflow: hidden;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #e7f4f0, #ffe1a6);
}

.card-image-wrap--back {
  height: 36%;
  min-height: 210px;
}

.card-image-wrap img,
.reward__card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.set-badge {
  display: inline-flex;
  margin: 0 0 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #e7f4f0;
  color: var(--teal-dark);
  font-size: 0.78rem;
  font-weight: 900;
}

.fact,
.joke,
.guide-callout p {
  color: #35474f;
  font-size: 1rem;
  line-height: 1.45;
}

.fact {
  font-style: italic;
}

.card-prompt {
  margin: 0 0 10px;
  color: var(--coral);
  font-size: 0.92rem;
  font-weight: 900;
  line-height: 1.28;
}

.card-actions,
.reward__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

#cardFeedbackButton {
  grid-column: 1 / -1;
}

.turn-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 42px;
  margin-top: 10px;
  border: 1px solid rgba(15, 111, 120, 0.2);
  border-radius: var(--radius);
  background: transparent;
  color: var(--teal-dark);
  font-weight: 900;
  cursor: pointer;
}

.guide-callout {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
  align-items: center;
  margin-top: 16px;
  padding: 12px;
  border-radius: var(--radius);
  background: #f3efe0;
}

.guide-callout img {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
}

.reward,
.feedback {
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(9, 73, 81, 0.78);
}

.reward__card,
.feedback article {
  position: relative;
  width: min(100%, 480px);
  max-height: 88vh;
  overflow-y: auto;
  padding: 18px;
  border-radius: var(--radius);
  background: var(--cream);
  box-shadow: var(--shadow);
}

.reward__card img {
  height: 270px;
  margin: 12px 0;
}

.reward__burst {
  position: absolute;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(244, 182, 63, 0.72) 0 28%, transparent 29%),
    conic-gradient(from 10deg, var(--gold), var(--coral), var(--teal), var(--gold));
  filter: blur(1px);
  animation: burst 1.8s ease-in-out infinite alternate;
}

.feedback p {
  color: #35474f;
  font-weight: 750;
  line-height: 1.42;
}

.feedback-actions {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.custom-marker {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 3px solid white;
  border-radius: 50% 50% 50% 4px;
  color: white;
  font-size: 0.72rem;
  font-weight: 900;
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.22);
  transform: rotate(-45deg);
}

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

.custom-marker.is-collected {
  border-color: var(--gold);
  box-shadow: 0 0 0 5px rgba(244, 182, 63, 0.35), 0 5px 14px rgba(0, 0, 0, 0.22);
}

.custom-marker.is-nearest {
  animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: rotate(-45deg) scale(1); }
  50% { transform: rotate(-45deg) scale(1.18); }
}

@keyframes burst {
  from { transform: scale(0.88) rotate(0deg); opacity: 0.5; }
  to { transform: scale(1.12) rotate(18deg); opacity: 0.76; }
}

.admin-body {
  min-height: 100vh;
  background: #e7f4f0;
}

.admin-shell {
  min-height: 100vh;
  padding: 18px;
}

.admin-login,
.admin-panel {
  width: min(100%, 1180px);
  margin: 0 auto;
}

.admin-login {
  display: grid;
  align-content: center;
  min-height: 100vh;
  max-width: 440px;
}

.admin-login h1,
.admin-header h1 {
  max-width: none;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.5rem, 8vw, 4rem);
}

.admin-copy {
  color: #35474f;
  font-weight: 750;
  line-height: 1.42;
}

.admin-copy--compact {
  margin: 12px 0;
  font-size: 0.9rem;
}

.admin-copy code {
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(15, 111, 120, 0.12);
  color: var(--teal-dark);
}

.admin-form {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.admin-form label {
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 900;
}

.admin-form input,
.json-table input,
.json-table select,
.json-table textarea {
  width: 100%;
  border: 1px solid rgba(15, 111, 120, 0.24);
  border-radius: var(--radius);
  background: white;
  color: var(--ink);
  font: inherit;
}

.admin-form input {
  min-height: 48px;
  padding: 0 12px;
}

.admin-status,
.editor-status {
  min-height: 1.4em;
  color: var(--coral);
  font-weight: 900;
}

.admin-back-link {
  margin-top: 16px;
  color: var(--teal-dark);
  font-weight: 900;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--cream);
  box-shadow: 0 8px 22px rgba(15, 73, 81, 0.12);
}

.admin-header__actions,
.editor-toolbar__group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-header .secondary-button,
.editor-toolbar .secondary-button,
.editor-toolbar .primary-button {
  width: auto;
  min-height: 42px;
  box-shadow: none;
}

.admin-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.admin-option {
  display: grid;
  gap: 4px;
  width: min(100%, 360px);
  padding: 12px;
  border: 2px solid var(--teal);
  border-radius: var(--radius);
  background: var(--cream);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.admin-option span {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.32;
}

.admin-editor {
  padding: 14px;
  border-radius: var(--radius);
  background: var(--cream);
  box-shadow: 0 8px 22px rgba(15, 73, 81, 0.12);
}

.editor-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.editor-status {
  margin: 10px 0;
  color: var(--teal-dark);
}

.editor-status[data-tone="success"] {
  color: var(--park);
}

.editor-status[data-tone="error"] {
  color: var(--coral);
}

.json-table-wrap {
  max-height: calc(100vh - 300px);
  min-height: 420px;
  overflow: auto;
  border: 1px solid rgba(15, 111, 120, 0.18);
  border-radius: var(--radius);
}

.json-table {
  width: 100%;
  min-width: 1880px;
  border-collapse: collapse;
  background: white;
  font-size: 0.84rem;
}

.json-table th,
.json-table td {
  border-bottom: 1px solid rgba(15, 111, 120, 0.14);
  border-right: 1px solid rgba(15, 111, 120, 0.1);
  padding: 7px;
  vertical-align: top;
}

.json-table th {
  position: sticky;
  z-index: 2;
  top: 0;
  background: #d7efe6;
  color: var(--teal-dark);
  font-size: 0.76rem;
  font-weight: 900;
  text-align: left;
  text-transform: uppercase;
}

.json-table input,
.json-table select {
  min-height: 34px;
  padding: 0 8px;
}

.json-table textarea {
  min-height: 96px;
  min-width: 230px;
  padding: 8px;
  resize: vertical;
  line-height: 1.35;
}

.json-table td:nth-child(1) input {
  width: 70px;
}

.json-table td:nth-child(6) input,
.json-table td:nth-child(7) input {
  width: 110px;
}

.photo-cell {
  display: grid;
  grid-template-columns: 54px 180px;
  gap: 8px;
  align-items: center;
}

.photo-cell img {
  width: 54px;
  height: 54px;
  border-radius: var(--radius);
  background: #f3efe0;
  object-fit: contain;
}

.photo-cell button {
  grid-column: 1 / -1;
  min-height: 32px;
  border: 1px solid rgba(15, 111, 120, 0.22);
  border-radius: var(--radius);
  background: #e7f4f0;
  color: var(--teal-dark);
  font-weight: 900;
  cursor: pointer;
}

.row-actions {
  display: grid;
  gap: 7px;
  min-width: 94px;
}

.row-actions button {
  min-height: 32px;
  border: 1px solid rgba(15, 111, 120, 0.22);
  border-radius: var(--radius);
  background: #e7f4f0;
  color: var(--teal-dark);
  font-weight: 900;
  cursor: pointer;
}

.marker-editor {
  min-height: 620px;
}

.marker-toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1.4fr) minmax(150px, 0.8fr) minmax(150px, 0.8fr) auto;
  gap: 10px;
  align-items: end;
}

.marker-toolbar label {
  display: block;
  margin-bottom: 5px;
  color: var(--teal-dark);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.marker-toolbar input,
.marker-toolbar select {
  width: 100%;
  min-height: 42px;
  padding: 0 10px;
  border: 1px solid rgba(15, 111, 120, 0.24);
  border-radius: var(--radius);
  background: white;
  color: var(--ink);
  font: inherit;
}

.marker-toolbar .secondary-button {
  width: auto;
  min-height: 42px;
}

.marker-map {
  height: min(66vh, 680px);
  min-height: 460px;
  overflow: hidden;
  border: 1px solid rgba(15, 111, 120, 0.18);
  border-radius: var(--radius);
  background: #d7efe6;
}

.admin-map-marker {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 3px solid white;
  border-radius: 50% 50% 50% 4px;
  background: var(--coral);
  color: white;
  font-size: 0.72rem;
  font-weight: 900;
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.22);
  transform: rotate(-45deg);
}

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

.admin-map-marker.is-selected {
  background: var(--teal);
  border-color: var(--gold);
  box-shadow: 0 0 0 5px rgba(244, 182, 63, 0.35), 0 5px 14px rgba(0, 0, 0, 0.22);
}

.audience-body {
  min-height: 100vh;
  background: #e7f4f0;
}

.audience-shell {
  display: grid;
  min-height: 100vh;
  padding: 18px;
}

.audience-hero,
.audience-panel {
  width: min(100%, 720px);
  margin: 0 auto;
}

.audience-hero {
  display: grid;
  gap: 18px;
  align-content: end;
  padding: 8px 0 18px;
}

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

.audience-hero__media img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  border: 3px solid white;
  border-radius: var(--radius);
  background: #fffdf5;
  box-shadow: 0 8px 22px rgba(15, 73, 81, 0.12);
}

.audience-hero h1 {
  max-width: 10ch;
  color: var(--ink);
  font-size: clamp(2.65rem, 13vw, 5rem);
}

.audience-lede {
  margin: 12px 0 0;
  max-width: 30ch;
  color: #35474f;
  font-size: 1.05rem;
  font-weight: 900;
  line-height: 1.25;
}

.audience-back-link {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  margin-top: 14px;
  padding: 0 13px;
  border-radius: var(--radius);
  background: var(--teal);
  color: white;
  font-weight: 900;
  text-decoration: none;
}

.audience-panel {
  padding: 14px;
  border-radius: var(--radius);
  background: var(--cream);
  box-shadow: 0 8px 22px rgba(15, 73, 81, 0.12);
}

.audience-form {
  display: grid;
  gap: 14px;
}

.audience-question {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 8px 10px;
  align-items: start;
}

.audience-question span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--teal);
  color: white;
  font-weight: 900;
}

.audience-question strong {
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.24;
}

.audience-question textarea,
.audience-question input {
  grid-column: 1 / -1;
  width: 100%;
  border: 1px solid rgba(15, 111, 120, 0.24);
  border-radius: var(--radius);
  background: white;
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
}

.audience-question textarea {
  min-height: 112px;
  padding: 12px;
  resize: vertical;
  line-height: 1.4;
}

.audience-question input {
  min-height: 48px;
  padding: 0 12px;
}

.audience-status {
  min-height: 1.35em;
  margin: 0;
  color: var(--teal-dark);
  font-weight: 900;
  line-height: 1.35;
}

.audience-status[data-tone="success"] {
  color: var(--park);
}

.audience-status[data-tone="error"] {
  color: var(--coral);
}

.audience-form .primary-button:disabled {
  opacity: 0.68;
  cursor: wait;
}

@media (max-width: 860px) {
  .marker-toolbar {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 760px) {
  .splash {
    grid-template-columns: minmax(320px, 520px) minmax(360px, 560px);
    gap: 32px;
    align-items: center;
    padding: 48px;
  }

  .splash.is-active {
    display: grid;
  }

  .splash__art {
    order: 2;
    grid-template-columns: 1fr 1fr;
    transform: rotate(2deg);
  }

  .splash__art img:first-child {
    grid-column: span 2;
    aspect-ratio: 2 / 1;
  }

  .splash__content {
    margin: 0;
  }

  .progress-panel {
    right: auto;
    bottom: 18px;
    left: 18px;
    width: 360px;
  }

  .treasure-rail {
    right: 18px;
    bottom: 18px;
    left: auto;
    width: min(48vw, 620px);
  }

  .collection-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .collection-card {
    grid-template-columns: 112px minmax(0, 1fr);
  }

  .audience-shell {
    grid-template-columns: minmax(300px, 0.85fr) minmax(360px, 1fr);
    gap: 32px;
    align-items: center;
    padding: 48px;
  }

  .audience-hero,
  .audience-panel {
    width: 100%;
  }

  .audience-hero {
    align-content: center;
    padding: 0;
  }

  .audience-hero__media {
    grid-template-columns: 1fr 1fr;
  }

  .audience-hero__media img:first-child {
    grid-column: span 2;
    aspect-ratio: 2 / 1;
  }
}

@media (max-width: 520px) {
  .topbar {
    flex-wrap: wrap;
  }

  .topbar__actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .icon-button {
    width: 100%;
  }

  .feedback-button--topbar {
    grid-column: 1 / -1;
    width: 100%;
  }

  .status-banner {
    top: 126px;
  }
}
