.map-topbar { padding-bottom: clamp(18px, 3vw, 30px); }
.map-topbar .episode-nav a { display: flex; align-items: center; gap: 8px; }
.album-count {
  padding: 4px 7px;
  border-radius: 6px;
  background: #e5eddc;
  color: #284335;
  font-size: .8rem;
  white-space: nowrap;
}

.map-heading { margin: 2px 0 24px; }
.map-heading h1 { font-size: clamp(2.35rem, 6vw, 4.8rem); }
.map-heading p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.24rem);
  line-height: 1.4;
}

.map-field {
  position: relative;
  isolation: isolate;
  min-height: clamp(390px, 39vw, 548px);
  display: grid;
  align-items: end;
  padding: clamp(21px, 4vw, 48px);
  overflow: hidden;
  border: 1px solid #4e754d63;
  border-radius: clamp(21px, 3vw, 34px);
  background: #809964 url("assets/adventure-map.jpg") center / cover no-repeat;
  box-shadow: 0 14px 42px #1a4b3628;
}

.map-markers {
  position: absolute;
  top: 29%;
  left: 17%;
  right: 14%;
  height: 17%;
  z-index: -1;
  color: #fff4cf;
}

.map-markers::before {
  content: "";
  position: absolute;
  inset: 11% 2% 0;
  transform: rotate(6deg);
  border-top: clamp(5px, .65vw, 8px) dotted;
  border-radius: 40%;
  filter: drop-shadow(1px 2px 2px #344d3370);
}

.map-markers span {
  position: absolute;
  top: 9%;
  left: 0;
  width: clamp(23px, 3.1vw, 37px);
  aspect-ratio: 1;
  transform: translate(-30%, -12%) rotate(45deg);
  border: 3px solid #fff9e8;
  border-radius: 50% 50% 8% 50%;
  background: radial-gradient(circle at center, #fff8e3 16%, var(--pin, #c45c35) 19%);
  box-shadow: 1px 3px 8px #162d255e;
}

.map-markers span:last-child { left: auto; right: 0; top: 65%; --pin: #326aa2; }
.map-stops {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  justify-content: space-between;
  gap: clamp(10px, 2vw, 24px);
  width: min(100%, 940px);
  margin-inline: auto;
}

.map-stop {
  display: grid;
  grid-template-columns: clamp(70px, 9vw, 108px) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 2px solid #fff9e7;
  border-radius: 18px;
  color: #19372d;
  background: #fffdf3;
  box-shadow: 0 8px 22px #183d3360;
  text-decoration: none;
}

.map-stop:hover { background: #f2f8d7; }
.journey-board {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  padding: 2px 8px 3px;
}
.journey-board::before { content: ""; position: absolute; left: 12px; right: 12px; height: 3px; background: #b3c3a7; }
.board-cell {
  position: relative;
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  border: 2px solid #96ac94;
  border-radius: 50%;
  background: #fffdf3;
  color: #19372d;
  font-size: .8rem;
}
.board-cell.passed { background: #9ac88a; }
.board-cell.current { transform: scale(1.16); border-color: #25493a; background: #e5f47e; }
.map-stop:focus-visible, .album-card:focus-visible {
  outline: 3px solid #2361bc;
  outline-offset: 3px;
}
.map-stop img {
  width: 100%;
  height: 100%;
  min-height: 110px;
  max-height: 145px;
  object-fit: cover;
  border-radius: 9px;
}
.map-stop[data-episode="elephants"] img { object-position: 70% center; }
.map-stop[data-episode="autodrome"] img { object-position: 71% center; }

.stop-details { display: grid; align-content: center; gap: 5px; min-width: 0; }
.stop-place, .stop-progress { color: var(--muted); font-size: .875rem; line-height: 1.2; }
.stop-name { font-size: clamp(1.18rem, 2.4vw, 1.65rem); font-weight: 820; letter-spacing: -.025em; line-height: 1.07; }
.stop-action {
  width: fit-content;
  max-width: 100%;
  margin-top: 3px;
  padding: 5px 9px;
  border-radius: 7px;
  background: #dce7c5;
  font-size: .875rem;
  font-weight: 800;
}

.postcard-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(14px, 3vw, 30px);
  max-width: 980px;
}

.album-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 5px;
  padding: 10px 10px 15px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--paper);
  color: var(--dark);
  text-align: left;
  box-shadow: 0 6px 22px #233c2414;
}
button.album-card:hover { background: #f4f8dc; }
.album-card img, .empty-postcard {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: contain;
  border-radius: 10px;
  background: #e4ebd8;
}
.empty-postcard {
  display: grid;
  place-items: center;
  background: repeating-linear-gradient(-42deg, #e9edda 0 16px, #e4e9d5 16px 32px);
  color: #4f6a4f;
  font-size: clamp(3rem, 8vw, 5rem);
}
.album-card strong { margin: 6px 4px 0; font-size: clamp(1.12rem, 2.1vw, 1.4rem); line-height: 1.2; }
.album-card small { margin-inline: 4px; color: var(--muted); font-size: .9rem; line-height: 1.3; }

.episode-frame {
  display: block;
  width: 100%;
  min-height: 435px;
  height: 740px;
  border: 0;
}

.postcard-dialog { width: min(850px, calc(100% - 26px)); }
.postcard-media img, .postcard-media video {
  display: block;
  width: 100%;
  max-height: min(62vh, 570px);
  object-fit: contain;
  border-radius: 10px;
  background: #152d25;
}
.postcard-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
  font-weight: 700;
  color: var(--muted);
}
.postcard-error { margin-bottom: 0; }

@media (max-width: 680px) {
  .map-field { min-height: 430px; background-position: 45% center; }
  .map-markers { top: 21%; }
  .map-stops { grid-template-columns: minmax(0, 330px); justify-content: center; gap: 11px; }
  .map-stop { padding: 8px; }
  .map-stop img { min-height: 93px; max-height: 122px; }
  .postcard-list { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 600px) {
  .map-topbar { display: flex; flex-wrap: wrap; }
  .map-heading { margin-bottom: 16px; }
}

/* The journeys are points along one route, not separate destination cards. */
.map-field { min-height: 560px; align-items: center; }
.map-path { position: absolute; left: 12%; right: 12%; top: 44%; border-top: 8px dotted #fff8d9; filter: drop-shadow(0 2px 2px #243e30); z-index: -1; }
.map-stops { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; align-items: start; width: 100%; }
.map-stop { display: flex; flex-direction: column; gap: 10px; padding: 0; border: 0; background: transparent; box-shadow: none; text-align: center; }
.map-stop:hover { background: transparent; }
.stop-point { position: relative; display: block; width: clamp(76px, 10vw, 120px); height: clamp(76px, 10vw, 120px); border: 5px solid #fff8e1; border-radius: 50%; background: #fff8e1; box-shadow: 0 5px 16px #183d3375; }
.map-stop img { width: 100%; height: 100%; min-height: 0; max-height: none; border-radius: 50%; object-fit: cover; }
.stop-number { position: absolute; display: grid; place-items: center; right: -8px; bottom: -5px; width: 31px; height: 31px; border: 2px solid white; border-radius: 50%; background: #c45c35; color: white; font-weight: 800; }
.stop-details { display: grid; width: 100%; min-height: 125px; align-content: start; gap: 4px; padding: 10px; border-radius: 14px; background: #fffdf3ed; box-shadow: 0 4px 12px #183d3340; }
.stop-name { font-size: clamp(1.08rem, 2vw, 1.45rem); }
.stop-action { justify-self: center; }
.journey-board { width: 100%; padding: 0 8px; }
.map-stop.locked { cursor: not-allowed; }
.map-stop.locked .stop-point { filter: grayscale(.9); opacity: .72; }
.map-stop.locked .stop-number { background: #637165; }
.map-stop.locked .stop-details { color: #536356; }
.map-stop.locked .stop-action { background: #e4e8df; }
@media (max-width: 680px) {
  .map-field { min-height: 670px; padding: 18px; }
  .map-stops { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; }
  .map-path { left: 25%; right: 25%; top: 20%; bottom: 20%; border: 0; border-left: 7px dotted #fff8d9; border-right: 7px dotted #fff8d9; }
  .stop-point { width: 78px; height: 78px; }
  .stop-details { min-height: 115px; }
}

/* Illustrated route from the approved mockup. */
:root { color-scheme: light; font-family: ui-rounded, "Avenir Next", system-ui, sans-serif; color: #193d36; background: #f1f6ec; }
* { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(circle at 75% 0,#e3f3e1,transparent 32%),#f1f6ec; }
button { font: inherit; cursor: pointer; }
.app { width:min(1420px,calc(100% - 64px)); margin: 0 auto; padding: 26px 0 36px; }
.header { display:flex; align-items:center; justify-content:space-between; gap:15px; }
.brand { display:flex; align-items:center; gap:11px; font-size:.8rem; font-weight:900; letter-spacing:.08em; }
.brand small { display:block; margin-top:3px; font-size:.58rem; letter-spacing:.11em; color:#6f8374; }
.brand-icon { display:grid; place-items:center; width:42px; height:42px; border-radius:14px; background:#215b50; color:#eaff91; font-size:1.3rem; }
.preview-badge { padding:8px 12px; border:1px solid #cbdcc8; border-radius:20px; color:#577466; font-size:.7rem; font-weight:800; letter-spacing:.08em; }
.intro { display:flex; justify-content:space-between; align-items:end; gap:15px; padding:30px 0 20px; }
.eyebrow { margin:0 0 6px; color:#d37c46; font-weight:900; letter-spacing:.15em; font-size:.72rem; }
h1 { margin:0; font-family:Georgia,serif; font-size:clamp(2.3rem,4vw,4rem); font-weight:500; letter-spacing:-.04em; line-height:1; }
h1 em { color:#337660; font-weight:500; }
.intro p:not(.eyebrow) { margin:10px 0 0; color:#657c70; font-size:1rem; }
.counter { display:grid; grid-template-columns:36px auto; align-items:center; column-gap:7px; padding:10px 18px; border:1px solid #dbe7d6; border-radius:18px; background:#fffef8; }
.counter span { grid-row:span 2; display:grid; place-items:center; width:34px; height:34px; background:#f9df81; border-radius:50%; color:#5e5721; }
.counter strong { font-size:1rem; }.counter small { color:#778b7e; }
.map-shell { padding:9px; background:#fffdf4; border-radius:28px; box-shadow:0 12px 35px #315b3b1b; }
.map-art { position:relative; width:100%; aspect-ratio: 16 / 9; overflow:hidden; border-radius:21px; background:#9fc9a3; isolation:isolate; }
.map-background { position:absolute; width:100%; height:100%; object-fit:fill; inset:0; }
.route { position:absolute; inset:0; width:100%; height:100%; overflow:visible; pointer-events:none; }
.path-shadow { fill:none; stroke:#2a583d; stroke-opacity:.35; stroke-width:8; stroke-linecap:round; }
.path-dashed { fill:none; stroke:#fff8d3; stroke-width:6; stroke-linecap:round; stroke-dasharray: 2 14; animation:march 2s linear infinite; }
.route-leg { fill:none; stroke:#ffd966; stroke-width:7; stroke-linecap:round; stroke-dasharray:2 14; opacity:0; transition:opacity .4s; }.route-leg.done { opacity:1; }
@keyframes march { to { stroke-dashoffset:-32; } }
.pin { position:absolute; transform:translate(-50%,-50%); width:clamp(38px,5vw,62px); aspect-ratio:1; border:4px solid #fffceb; border-radius:50%; background:#f6c750; color:#284e3e; box-shadow:0 4px 12px #163c32a0; font-weight:900; font-size:clamp(.9rem,1.4vw,1.2rem); transition: transform .2s,filter .2s; z-index:2; }
.pin:hover,.pin:focus-visible { transform:translate(-50%,-50%) scale(1.12); outline:3px solid #245d4d; outline-offset:3px; }
.pin.locked { background:#e9efe2; color:#73847c; filter:grayscale(.55); }
.pin.completed { background:#67ad82; color:white; }.pin.current { background:#ffd965; }
.pin span { display:block; font-size:.62em; line-height:1; }
.token { position:absolute; left:18%; top:75%; width:clamp(25px,3vw,38px); height:clamp(25px,3vw,38px); display:grid; place-items:center; border:3px solid white; border-radius:50%; background:#235a50; color:#ffffa1; transform:translate(-50%,-130%); z-index:4; box-shadow:0 3px 8px #214c3a88; pointer-events:none; }
.map-note { position:absolute; left:18px; bottom:16px; padding:9px 14px; border-radius:20px; background:#fffdf1ee; color:#456456; font-size:.8rem; font-weight:750; box-shadow:0 3px 12px #173d2e30; }
.detail { display:flex; gap:18px; align-items:center; padding:16px; margin-top:14px; border:1px solid #dce9d9; border-radius:21px; background:#fffef8; box-shadow:0 8px 22px #33593d0e; }
.detail-photo { flex:0 0 132px; height:92px; border-radius:13px; overflow:hidden; background:#e2eadc; }.detail-photo img { width:100%;height:100%;object-fit:cover; }
.detail-copy { flex:1; min-width:0; }.detail-kicker { font-size:.69rem; letter-spacing:.12em; font-weight:850; color:#c77a4e; } h2 { margin:4px 0; font-size:1.35rem; } .detail-copy p { margin:0;color:#61766b;line-height:1.4; }.hint { margin-top:7px; font-size:.82rem;color:#477d5f;font-weight:750; }
.detail-actions { display:flex; flex-direction:column; align-items:stretch; gap:6px; min-width:175px; }.primary,.secondary { border:0; border-radius:12px; padding:11px 15px; font-weight:800; }.primary { color:white; background:#286755; }.primary:disabled { opacity:.5; cursor:not-allowed; }.secondary { color:#6b8074; background:transparent; font-size:.8rem; }.footnote { color:#839488; font-size:.82rem; text-align:center; }
@media (max-width:700px) { .app { width:calc(100% - 24px); padding-top:15px; }.intro { padding:22px 0 15px; }.intro p:not(.eyebrow) { font-size:.88rem; }.counter { padding:8px; }.counter span { display:none; }.counter { grid-template-columns:auto; }.map-shell { padding:5px; border-radius:17px; }.map-art { border-radius:13px; aspect-ratio: 16 / 9; }.map-note { font-size:.65rem; left:8px; bottom:8px; padding:6px 9px; }.detail { align-items:flex-start; flex-wrap:wrap; gap:12px; }.detail-photo { flex-basis:90px; height:75px; }.detail-actions { flex:1 0 100%; flex-direction:row; }.primary,.secondary { flex:1; }.preview-badge { font-size:.6rem; } }
@media (prefers-reduced-motion:reduce) { .path-dashed { animation:none; }.pin,.route-leg { transition:none; } }

.pin-label { position:absolute; top:calc(100% + 4px); left:50%; transform:translateX(-50%); background:#fffdf3ee; color:#315345; padding:4px 8px; border-radius:10px; white-space:nowrap; font-size:clamp(.56rem,.9vw,.76rem); line-height:1.1; box-shadow:0 2px 7px #20443144; }
@media(max-width:700px) { .pin-label { font-size:.58rem; padding:3px 5px; } .pin { width:34px; border-width:3px; } }

body { max-width:1540px; padding:0 clamp(16px,4vw,64px) 24px; }
.intro h1 { font-family:Georgia,serif; }
.map-art .token { left:18%; top:75%; }
.pin-label { display:block; }
@media (max-width:700px) { body { padding:0 12px 24px; } }

.preview-link { display:block; text-align:center; color:#356958; padding:8px 10px; font-weight:700; font-size:.85rem; }

/* Keep the illustrated route centred and entirely visible at every screen size. */
body { margin-inline: auto; }
#map-view:not([hidden]) {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
#map-view .intro,
#map-view .map-shell {
  width: 100%;
  max-width: min(100%, max(300px, calc((100dvh - 320px) * 16 / 9)));
  margin-inline: auto;
}

/* Numbered stops sit beside the landmarks so the illustrations stay visible. */
.pin { width: clamp(32px, 3vw, 42px); border-width: 3px; }
.pin .pin-icon { font-size: 1rem; line-height: 1; font-weight: 900; }
.pin.locked { color: #4a6058; }
.token { width: 28px; height: 28px; transform: translate(-50%, -135%); }
.map-status { text-align: center; color: #456456; font-weight: 700; }
@media (max-width: 700px) {
  .pin { width: 30px; }
  .token { width: 23px; height: 23px; }
}
