:root {
  color-scheme: dark;
  --sand: #f7c766;
  --wood: #a75a24;
  --rust: #e34b22;
  --ocean: #0e8caa;
  --deep: #061014;
  --ink: #10100d;
  --paper: #f2d59a;
  --acid: #d8ff4d;
  --line: rgba(247, 199, 102, 0.38);
  --white: #fff6dd;
  --muted: rgba(255, 246, 221, 0.68);
  font-family:
    Impact, Haettenschweiler, "Arial Narrow Bold", "Franklin Gothic Condensed",
    Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 22% 14%, rgba(227, 75, 34, 0.22), transparent 28rem),
    linear-gradient(145deg, #071015 0%, #0c2730 43%, #091115 100%);
  color: var(--white);
  overflow-x: hidden;
}

button,
a {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(360px, 500px);
  gap: clamp(18px, 2.4vw, 34px);
  padding: clamp(14px, 2.2vw, 28px);
}

body.no-selection .app-shell {
  grid-template-columns: minmax(360px, 1fr);
}

body.no-selection .dossier {
  display: none;
}

body.no-selection .poster-stage {
  max-width: 1180px;
  width: 100%;
  justify-self: center;
}

.poster-stage {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
}

.poster-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
  border-bottom: 2px dashed rgba(247, 199, 102, 0.36);
  padding-bottom: 12px;
}

.kicker,
.stop-number,
.dossier-topline,
.map-head,
.intel-card span,
.passport-head,
.quick-actions,
.rules span {
  letter-spacing: 0;
  text-transform: uppercase;
}

.kicker {
  margin: 0 0 3px;
  color: var(--sand);
  font-size: 0.86rem;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(2.5rem, 6vw, 6rem);
  line-height: 0.82;
  text-shadow: 4px 4px 0 #000;
  color: #f7efe0;
}

.mission-status {
  display: grid;
  gap: 6px;
  justify-items: end;
  color: var(--sand);
  font-size: clamp(0.84rem, 1.4vw, 1.05rem);
  text-align: right;
}

.mission-status span:first-child {
  color: var(--acid);
}

#missionProgress {
  max-width: 30ch;
  font-size: 1.18rem;
  font-weight: 800;
  line-height: 1.15;
}

.flyer-wrap {
  position: relative;
  width: min(100%, calc((100vh - 116px) * 741 / 1118));
  max-width: 860px;
  margin: 0 auto;
  aspect-ratio: 741 / 1118;
  filter: drop-shadow(0 24px 30px rgba(0, 0, 0, 0.42));
}

.flyer {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border: 4px solid #111;
  background: #0b2b32;
}

.hotspot-layer {
  position: absolute;
  inset: 0;
}

.first-stop-hint {
  position: absolute;
  z-index: 4;
  left: 37%;
  top: 75%;
  pointer-events: none;
  font-size: clamp(30px, 5.8vw, 56px);
  line-height: 1;
  filter:
    drop-shadow(0 4px 0 rgba(0, 0, 0, 0.9))
    drop-shadow(0 0 8px rgba(255, 246, 221, 0.72));
  transform-origin: 50% 70%;
  animation: pointFirstStop 1.8s ease-in-out infinite;
}

.first-stop-hint.is-hidden {
  display: none;
}

@keyframes pointFirstStop {
  0%,
  100% {
    transform: translate(-50%, -50%) translateX(-6px) rotate(-12deg);
  }

  50% {
    transform: translate(-50%, -50%) translateX(12px) rotate(-4deg);
  }
}

.hotspot {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--w);
  height: var(--h);
  translate: -50% -50%;
  border: 2px solid transparent;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  outline: 0;
  transition:
    background 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease,
    scale 140ms ease;
}

.hotspot::before {
  content: "";
  position: absolute;
  inset: -7px;
  border: 1px dashed rgba(255, 246, 221, 0);
  border-radius: 8px;
}

/* The flyer art already prints each stop number, so the hotspot itself
   shows NO number — only a check badge once the stop is stamped. */
.hotspot::after {
  content: "✓";
  display: none;
  position: absolute;
  top: 3px;
  right: 3px;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 2px solid #0d2a1c;
  border-radius: 50%;
  background: #1b8f5f;
  color: #eafff2;
  font-size: 0.8rem;
  text-shadow: 1px 1px #000;
  box-shadow: 0 2px 0 #000;
}

.hotspot:hover,
.hotspot:focus-visible,
.hotspot.active {
  background: rgba(216, 255, 77, 0.14);
  border-color: var(--acid);
  box-shadow:
    0 0 0 4px rgba(6, 16, 20, 0.58),
    0 0 24px rgba(216, 255, 77, 0.72);
  scale: 1.04;
}

.hotspot:hover::before,
.hotspot:focus-visible::before,
.hotspot.active::before {
  border-color: rgba(255, 246, 221, 0.74);
}

.hotspot.stamped {
  border-color: rgba(247, 199, 102, 0.92);
}

.hotspot.stamped::after {
  display: grid;
}

.dossier {
  position: sticky;
  top: clamp(12px, 2vw, 24px);
  align-self: start;
  min-height: calc(100vh - clamp(28px, 4.4vw, 56px));
  display: grid;
  gap: 14px;
  padding: clamp(16px, 2.2vw, 22px);
  border: 1px solid rgba(247, 199, 102, 0.36);
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px) 0 0 / 100% 28px,
    radial-gradient(circle at 88% 10%, rgba(216, 255, 77, 0.12), transparent 16rem),
    linear-gradient(180deg, rgba(8, 19, 22, 0.96), rgba(8, 13, 15, 0.98));
  box-shadow:
    inset 0 0 0 4px rgba(0, 0, 0, 0.34),
    0 24px 50px rgba(0, 0, 0, 0.38);
}

.dossier::after {
  content: "";
  pointer-events: none;
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.04), transparent 24%, rgba(0, 0, 0, 0.08));
  mix-blend-mode: overlay;
}

.dossier.is-closed {
  display: none;
}

.dossier-cover,
.dossier-body {
  position: relative;
  z-index: 1;
}

.dossier-cover {
  display: grid;
  gap: 16px;
  min-height: clamp(300px, 48vh, 540px);
  align-content: center;
  border: 1px dashed rgba(247, 199, 102, 0.38);
  background:
    linear-gradient(135deg, rgba(247, 199, 102, 0.08), transparent 34%),
    radial-gradient(circle at 68% 34%, rgba(216, 255, 77, 0.1), transparent 13rem),
    rgba(0, 0, 0, 0.22);
  padding: clamp(18px, 3vw, 30px);
}

.dossier-body {
  display: grid;
  gap: 14px;
}

.dossier.is-closed .dossier-body,
.dossier.is-open .dossier-cover {
  display: none;
}

.file-tab {
  justify-self: start;
  padding: 6px 10px;
  border: 1px solid rgba(216, 255, 77, 0.52);
  color: var(--acid);
  background: rgba(0, 0, 0, 0.32);
  font-size: 0.86rem;
}

.dossier-cover h2 {
  max-width: 9ch;
  color: #fff6dd;
}

.dossier-cover p {
  max-width: 32ch;
  color: var(--muted);
  font-family: "Arial Narrow", Arial, sans-serif;
  font-size: 1.05rem;
  line-height: 1.3;
}

.cover-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  max-width: 320px;
}

.cover-grid span {
  aspect-ratio: 1;
  border: 1px dashed rgba(247, 199, 102, 0.34);
  background: rgba(14, 140, 170, 0.08);
}

.cover-hint {
  color: var(--sand) !important;
  text-transform: uppercase;
  font-size: 0.82rem !important;
}

.dossier-topline {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--sand);
  font-size: 0.78rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 9px;
}

.dossier-header {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px;
  gap: 14px;
  align-items: start;
}

.stop-number {
  color: var(--acid);
  font-size: 0.9rem;
}

h2 {
  font-size: clamp(2.1rem, 4vw, 3.7rem);
  line-height: 0.86;
  color: #fff6dd;
  text-shadow: 3px 3px 0 #000;
}

#stopLocation {
  color: var(--sand);
  margin-top: 5px;
  font-size: 1.05rem;
}

.icon-button {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(216, 255, 77, 0.42);
  color: var(--acid);
  background: rgba(0, 0, 0, 0.34);
  cursor: pointer;
}

.icon-button:hover,
.icon-button:focus-visible,
.action-button:hover,
.action-button:focus-visible,
.quick-actions a:hover,
.quick-actions button:hover,
.quick-actions a:focus-visible,
.quick-actions button:focus-visible,
.passport-head button:hover,
.passport-head button:focus-visible {
  filter: brightness(1.1);
  outline: 2px solid rgba(216, 255, 77, 0.72);
  outline-offset: 2px;
}

.photo-map-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(190px, 1.15fr);
  gap: 12px;
}

.photo-frame {
  position: relative;
  min-height: 220px;
  overflow: hidden;
  border: 1px solid rgba(247, 199, 102, 0.46);
  background: #050809;
}

.photo-frame::before {
  content: attr(data-label);
  position: absolute;
  z-index: 2;
  left: 10px;
  top: 10px;
  padding: 4px 7px;
  background: rgba(227, 75, 34, 0.92);
  color: #fff7df;
  font-size: 0.72rem;
}

.photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  filter: saturate(0.92) contrast(1.08);
}

.locator-card {
  min-height: 248px;
  border: 1px solid rgba(14, 140, 170, 0.68);
  background:
    linear-gradient(rgba(14, 140, 170, 0.1) 1px, transparent 1px) 0 0 / 22px 22px,
    linear-gradient(90deg, rgba(14, 140, 170, 0.1) 1px, transparent 1px) 0 0 / 22px 22px,
    #061014;
  overflow: hidden;
}

.map-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  color: #8deaff;
  border-bottom: 1px solid rgba(14, 140, 170, 0.42);
  font-size: 0.72rem;
}

.mini-map {
  position: relative;
  height: calc(100% - 34px);
  min-height: 214px;
  overflow: hidden;
  background:
    linear-gradient(rgba(14, 140, 170, 0.1) 1px, transparent 1px) 0 0 / 18px 18px,
    linear-gradient(90deg, rgba(14, 140, 170, 0.1) 1px, transparent 1px) 0 0 / 18px 18px,
    #061014;
}

.map-land,
.map-water,
.road,
.map-cross,
.route-svg,
.venue-block,
.pier-spur,
.map-dot {
  position: absolute;
}

.map-land {
  inset: 0 28% 0 0;
  background:
    radial-gradient(circle at 18% 20%, rgba(247, 199, 102, 0.1), transparent 28px),
    linear-gradient(90deg, rgba(167, 90, 36, 0.16), rgba(247, 199, 102, 0.06));
}

.map-water {
  inset: 0 0 0 62%;
  display: grid;
  place-items: center;
  color: rgba(141, 234, 255, 0.72);
  background:
    repeating-linear-gradient(160deg, rgba(141, 234, 255, 0.13) 0 2px, transparent 2px 12px),
    linear-gradient(180deg, rgba(14, 140, 170, 0.32), rgba(3, 44, 58, 0.92));
  border-left: 2px solid rgba(141, 234, 255, 0.32);
  font-size: 0.62rem;
  text-transform: uppercase;
}

.road {
  top: -8%;
  height: 116%;
  width: 7px;
  border-radius: 999px;
  background: rgba(255, 246, 221, 0.2);
  box-shadow: 0 0 0 1px rgba(255, 246, 221, 0.08);
}

.road span,
.map-cross span {
  position: absolute;
  left: 10px;
  top: 9px;
  color: rgba(255, 246, 221, 0.58);
  font-size: 0.58rem;
  text-transform: uppercase;
  white-space: nowrap;
}

.road-bypass {
  left: 23%;
  transform: rotate(-4deg);
}

.road-main {
  left: 45%;
  background: rgba(247, 199, 102, 0.2);
  transform: rotate(3deg);
}

.road-ocean {
  left: 59%;
  width: 4px;
  background: rgba(141, 234, 255, 0.26);
  transform: rotate(2deg);
}

.map-cross {
  left: 10%;
  right: 34%;
  height: 1px;
  background: rgba(255, 246, 221, 0.2);
}

.mp-6 {
  top: 9%;
}

.mp-16-5 {
  top: 76%;
}

.mp-18-5 {
  top: 89%;
}

.route-svg {
  inset: 0;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 8px rgba(247, 199, 102, 0.34));
}

.route-svg path {
  fill: none;
  stroke: var(--sand);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-dasharray: 5 4;
}

.venue-block {
  left: calc(var(--map-x) + 5%);
  top: var(--dot-y);
  translate: 0 -50%;
  max-width: 74px;
  padding: 3px 5px;
  border: 1px solid rgba(247, 199, 102, 0.34);
  background: rgba(6, 16, 20, 0.82);
  color: rgba(255, 246, 221, 0.74);
  font-family: "Arial Narrow", Arial, sans-serif;
  font-size: 0.64rem;
  line-height: 0.95;
  text-transform: uppercase;
  white-space: nowrap;
}

.venue-block.active {
  color: #1c0903;
  border-color: var(--acid);
  background: var(--acid);
}

.pier-spur {
  left: var(--map-x);
  top: var(--dot-y);
  width: 27%;
  height: 3px;
  translate: 5px -50%;
  background: rgba(141, 234, 255, 0.42);
}

.map-dot {
  left: var(--map-x);
  top: var(--dot-y);
  width: 15px;
  height: 15px;
  translate: -50% -50%;
  border-radius: 50%;
  background: #113036;
  border: 2px solid rgba(141, 234, 255, 0.78);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.28);
}

.map-dot.active {
  width: 24px;
  height: 24px;
  background: var(--rust);
  border-color: var(--acid);
  box-shadow: 0 0 20px rgba(216, 255, 77, 0.8);
}

.intel-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.intel-card,
.rules {
  border: 1px solid rgba(247, 199, 102, 0.32);
  background: rgba(0, 0, 0, 0.25);
  padding: 11px;
}

.intel-card span,
.rules span {
  display: block;
  color: var(--sand);
  font-size: 0.74rem;
  margin-bottom: 5px;
}

.intel-card strong {
  display: block;
  color: #fff7de;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  line-height: 1;
}

.action-button {
  min-height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(247, 199, 102, 0.42);
  background: rgba(0, 0, 0, 0.32);
  color: #fff6dd;
  text-decoration: none;
  cursor: pointer;
}

.action-button.primary {
  color: #1c0903;
  border-color: #f8e1a4;
  background: var(--sand);
}

.rules p {
  color: #fff6dd;
  line-height: 1.25;
}

.passport {
  position: relative;
  z-index: 1;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(247, 199, 102, 0.1), rgba(227, 75, 34, 0.08));
  padding: 10px;
}

.passport-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  color: var(--sand);
  font-size: 0.74rem;
  margin-bottom: 8px;
}

.passport-head button {
  border: 1px solid rgba(247, 199, 102, 0.4);
  background: transparent;
  color: var(--sand);
  cursor: pointer;
  padding: 4px 8px;
}

.passport-stamps {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.stamp {
  min-width: 0;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(255, 246, 221, 0.34);
  color: rgba(255, 246, 221, 0.46);
  font-size: 0.84rem;
  background: rgba(0, 0, 0, 0.2);
}

.stamp.done {
  border-style: solid;
  color: #102019;
  background: var(--acid);
  transform: rotate(-4deg);
}

.quick-actions {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.quick-actions a,
.quick-actions button {
  min-height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(14, 140, 170, 0.52);
  background: rgba(14, 140, 170, 0.12);
  color: #aef1ff;
  text-decoration: none;
  cursor: pointer;
  text-align: center;
  padding: 4px;
  font-size: 0.86rem;
}

.rules {
  position: relative;
  z-index: 1;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  translate: -50% 120%;
  padding: 10px 14px;
  background: #10100d;
  color: var(--acid);
  border: 1px solid rgba(216, 255, 77, 0.54);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.42);
  transition: translate 180ms ease;
  z-index: 10;
}

.toast.show {
  translate: -50% 0;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .poster-toolbar {
    align-items: flex-start;
  }

  .flyer-wrap {
    width: min(100%, 620px);
  }

  .dossier {
    position: relative;
    top: auto;
    min-height: 0;
  }
}

@media (max-width: 640px) {
  .poster-toolbar {
    display: grid;
  }

  .mission-status {
    justify-items: start;
    text-align: left;
  }

  #missionProgress {
    max-width: 22ch;
    font-size: 1.28rem;
  }

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

  .photo-frame,
  .locator-card {
    min-height: 210px;
  }

  .quick-actions {
    grid-template-columns: 1fr;
  }

  .hotspot {
    border-width: 1px;
  }

  .hotspot::after {
    width: 20px;
    height: 20px;
    font-size: 0.75rem;
  }
}
