*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Amsterdam palette
   #fb9a17  orange  — primary CTAs, highlights, badges
   #fb050b  red     — danger / close actions
   #145450  teal    — secondary borders / accents
   #3c353c  charcoal — panel & overlay backgrounds
   #5a463f  brown   — map button backgrounds
*/

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #3c353c;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ─── Map ─────────────────────────────────────────────── */
#map {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.leaflet-bottom.leaflet-right {
  bottom: 4px;
  right: 4px;
}

.leaflet-control-attribution {
  background: rgba(0, 0, 0, 0.45) !important;
  color: rgba(255, 255, 255, 0.45) !important;
  font-size: 9px !important;
  padding: 2px 5px !important;
  border-radius: 4px !important;
}

.leaflet-control-attribution a {
  color: rgba(255, 255, 255, 0.55) !important;
}

/* ─── Hide marker labels when zoomed out (< zoom 15) ──── */
#map.labels-hidden .highlight-marker-label {
  display: none;
}

/* ─── Simulation mode indicator ─────────────────────── */
#sim-badge {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 800;
  background: rgba(251, 5, 11, 0.85);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  padding: 4px 9px;
  border-radius: 6px;
  pointer-events: none;
}

#sim-badge[hidden] { display: none; }

/* ─── New-highlight badge ────────────────────────────── */
#nearby-badge {
  position: fixed;
  bottom: calc(95vh - 20px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 700;
  background: #fb9a17;
  color: #fff;
  border-radius: 20px;
  padding: 9px 18px;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 2px 14px rgba(251, 154, 23, 0.55);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  -webkit-tap-highlight-color: transparent;
  animation: badge-pop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#nearby-badge[hidden] { display: none; }

@keyframes badge-pop {
  from { transform: translateX(-50%) scale(0.7); opacity: 0; }
  to   { transform: translateX(-50%) scale(1);   opacity: 1; }
}

/* ─── End screen overlay ─────────────────────────────── */
#end-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #3c353c;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fade-in 0.4s ease;
}

#end-screen[hidden] {
  display: none;
}

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

.end-screen-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: 320px;
  width: 100%;
  text-align: center;
}

.end-screen-logo {
  font-size: 52px;
  margin-bottom: 4px;
}

#end-title {
  font-size: 24px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.3;
  letter-spacing: -0.4px;
}

#end-subtitle {
  font-size: 16px;
  line-height: 1.6;
  color: rgba(255, 215, 150, 0.8);
  margin-bottom: 8px;
}

#review-btn {
  display: block;
  width: 100%;
  padding: 18px 24px;
  border-radius: 14px;
  background: #fb9a17;
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  text-decoration: none;
  text-align: center;
  box-shadow: 0 4px 24px rgba(251, 154, 23, 0.45);
  transition: background 0.2s, transform 0.15s;
  -webkit-tap-highlight-color: transparent;
}

#review-btn:active {
  background: #e08914;
  transform: scale(0.97);
}

#continue-btn {
  width: 100%;
  padding: 14px 24px;
  border-radius: 14px;
  border: 1px solid rgba(251, 154, 23, 0.35);
  background: transparent;
  color: rgba(255, 215, 150, 0.8);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s;
}

#continue-btn:active {
  background: rgba(251, 154, 23, 0.1);
}

/* ─── Language picker ────────────────────────────────── */
#lang-picker {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #3c353c;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  transition: opacity 0.4s ease, visibility 0.4s ease, background 0.5s ease;
}

/* Step 2: show the basemap through a semi-transparent overlay */
#lang-picker.map-visible {
  background: rgba(60, 53, 60, 0.6);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

#lang-picker.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.lang-picker-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: 320px;
  width: 100%;
  text-align: center;
}

.lang-picker-logo {
  font-size: 48px;
  margin-bottom: 4px;
}

.lang-picker-title {
  font-size: 26px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.5px;
}

.lang-picker-subtitle {
  font-size: 15px;
  color: rgba(255, 220, 160, 0.85);
  margin-bottom: 12px;
}

.lang-picker-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

/* ─── Step 2: start button ───────────────────────────── */
#step-start {
  width: 100%;
  margin-top: 8px;
}

#start-btn {
  width: 100%;
  padding: 20px 24px;
  border-radius: 14px;
  border: none;
  background: #fb9a17;
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.2px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 4px 28px rgba(251, 154, 23, 0.6);
  transition: background 0.2s, transform 0.15s;
}

#start-btn:active {
  background: #e08914;
  transform: scale(0.97);
}

.lang-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 18px 24px;
  border-radius: 14px;
  border: 2px solid rgba(251, 154, 23, 0.7);
  background: rgba(251, 154, 23, 0.15);
  color: #ffffff;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}

.lang-btn:active {
  background: rgba(251, 154, 23, 0.35);
  transform: scale(0.97);
}

.lang-flag {
  font-size: 24px;
}

/* ─── Boat "you are here" marker ─────────────────────── */
.boat-marker-wrapper {
  width: 84px;
  height: 56px;
}

.boat-marker-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.7));
  animation: boat-pulse 2s ease-in-out infinite;
}

@keyframes boat-pulse {
  0%, 100% { transform: scale(1);    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.7)); }
  50%       { transform: scale(1.1); filter: drop-shadow(0 3px 10px rgba(251,154,23,0.6)); }
}

/* ─── Highlight markers ──────────────────────────────── */
.highlight-marker-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  cursor: pointer;
}

.highlight-marker-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2.5px solid #fb9a17;
  background-color: #fb9a17;
  background-size: cover;
  background-position: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.55);
  transition: transform 0.15s;
}

.highlight-marker-no-img {
  background-image: none;
}

.highlight-marker-label {
  background: rgba(60, 53, 60, 0.85);
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 10px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  pointer-events: none;
  letter-spacing: 0.2px;
  transition: opacity 0.2s;
}

/* ─── End tour button ────────────────────────────────── */
#end-tour-btn {
  position: fixed;
  bottom: 24px;
  left: 16px;
  z-index: 500;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: rgba(90, 70, 63, 0.9);
  color: #fb050b;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.15s;
  -webkit-tap-highlight-color: transparent;
}

#end-tour-btn svg {
  width: 22px;
  height: 22px;
}

#end-tour-btn:active {
  background: rgba(251, 5, 11, 0.2);
  transform: scale(0.93);
}

/* ─── Locate-me button ───────────────────────────────── */
#locate-btn {
  position: fixed;
  bottom: 24px;
  right: 16px;
  z-index: 500;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: rgba(90, 70, 63, 0.9);
  color: #ffc460;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.15s;
  -webkit-tap-highlight-color: transparent;
}

#locate-btn svg {
  width: 22px;
  height: 22px;
}

#locate-btn:active {
  background: rgba(251, 154, 23, 0.25);
  transform: scale(0.93);
}

/* ─── Highlight panel ────────────────────────────────── */
#highlight-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 600;
  background: rgba(60, 53, 60, 0.97);
  border-top: 1px solid rgba(251, 154, 23, 0.35);
  border-radius: 20px 20px 0 0;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);

  transform: translateY(100%);
  transition: transform 0.38s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform;

  max-height: 95vh;
  display: flex;
  flex-direction: column;
}

#highlight-panel.visible {
  transform: translateY(0);
}

.panel-handle {
  flex-shrink: 0;
  width: 40px;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  margin: 12px auto 16px;
}

/* ─── Red X dismiss button ───────────────────────────── */
#panel-close-x {
  position: absolute;
  top: 10px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: #fb050b;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s, transform 0.15s;
  box-shadow: 0 2px 8px rgba(251, 5, 11, 0.5);
}

#panel-close-x:active {
  background: #c8000a;
  transform: scale(0.92);
}

/* ─── Image carousel ─────────────────────────────────── */
#image-carousel {
  display: none;
  position: relative;
  width: 100%;
  aspect-ratio: 800 / 500;
  max-height: 55vh;
  overflow: hidden;
  border-radius: 16px 16px 0 0;
  background: rgba(255, 255, 255, 0.05);
  margin-bottom: 16px;
}

#image-carousel.has-image {
  display: block;
}

#highlight-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

#img-prev,
#img-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 56px;
  border: none;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
  border-radius: 4px;
}

#img-prev { left: 0; border-radius: 0 4px 4px 0; }
#img-next { right: 0; border-radius: 4px 0 0 4px; }

#img-prev:active,
#img-next:active {
  background: rgba(0, 0, 0, 0.7);
}

#img-prev:disabled,
#img-next:disabled {
  opacity: 0;
  pointer-events: none;
}

#img-counter {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 10px;
  pointer-events: none;
  white-space: nowrap;
}

/* ─── Overview mode ─────────────────────────────────── */
#panel-overview .panel-content {
  padding-bottom: 8px;
}

#overview-title {
  font-size: 20px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.3;
  margin-bottom: 16px;
}

#overview-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  counter-reset: overview-counter;
}

#overview-list li {
  counter-increment: overview-counter;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 16px;
  color: rgba(255, 240, 210, 0.9);
  line-height: 1.3;
}

#overview-list li::before {
  content: counter(overview-counter);
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(251, 154, 23, 0.2);
  border: 1px solid rgba(251, 154, 23, 0.45);
  color: #ffc460;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

#overview-start-btn {
  display: block;
  width: 100%;
  padding: 16px;
  border-radius: 12px;
  border: none;
  background: #fb9a17;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s, transform 0.15s;
  box-shadow: 0 4px 16px rgba(251, 154, 23, 0.35);
}

#overview-start-btn:active {
  background: #e08914;
  transform: scale(0.97);
}

#overview-close-btn {
  display: block;
  width: 100%;
  padding: 14px;
  border: 1px solid rgba(251, 154, 23, 0.35);
  border-radius: 12px;
  background: transparent;
  color: rgba(255, 215, 150, 0.8);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s;
}

#overview-close-btn:active {
  background: rgba(251, 154, 23, 0.1);
}

/* ─── Panel detail: flex column so content can scroll ── */
#panel-detail {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

/* ─── Panel scrollable content ───────────────────────── */
.panel-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0;
  -webkit-overflow-scrolling: touch;
}

/* Text content below the image gets its own padding */
.detail-text {
  padding: 16px 20px 4px;
}

#highlight-name {
  font-size: 22px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
  margin-bottom: 10px;
  letter-spacing: -0.3px;
}

#highlight-short-desc {
  font-size: 17px;
  line-height: 1.6;
  color: rgba(255, 240, 210, 0.9);
  padding-bottom: 4px;
}

#highlight-description {
  font-size: 16px;
  line-height: 1.6;
  color: rgba(255, 235, 200, 0.85);
  padding-bottom: 4px;
}

/* ─── Teaser footer ──────────────────────────────────── */
#more-btn {
  display: block;
  width: 100%;
  padding: 16px;
  border-radius: 12px;
  border: none;
  background: #fb9a17;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 4px 16px rgba(251, 154, 23, 0.35);
  transition: background 0.2s, transform 0.15s;
}

#more-btn:active {
  background: #e08914;
  transform: scale(0.97);
}

#next-teaser-btn {
  display: block;
  width: 100%;
  padding: 16px;
  border: 1px solid rgba(251, 154, 23, 0.35);
  border-radius: 12px;
  background: rgba(251, 154, 23, 0.1);
  color: #ffc460;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s;
}

#next-teaser-btn:active {
  background: rgba(251, 154, 23, 0.25);
}

#next-teaser-btn[hidden] { display: none; }

/* ─── Panel footer: nav + close ─────────────────────── */
.panel-footer {
  flex-shrink: 0;
  padding: 14px 20px 32px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Ensure hidden attribute beats display:flex on panel-footer children */
.panel-footer[hidden] { display: none !important; }

.panel-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.panel-nav button {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(251, 154, 23, 0.35);
  background: rgba(251, 154, 23, 0.1);
  color: #ffc460;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s, opacity 0.2s;
  flex-shrink: 0;
}

.panel-nav button svg {
  width: 18px;
  height: 18px;
}

.panel-nav button:active {
  background: rgba(251, 154, 23, 0.3);
}

.panel-nav button:disabled {
  opacity: 0.25;
  cursor: default;
}

#nav-counter {
  flex: 1;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 215, 150, 0.7);
  letter-spacing: 0.5px;
}

#close-panel {
  display: block;
  width: 100%;
  padding: 14px;
  border: 1px solid rgba(251, 154, 23, 0.35);
  border-radius: 12px;
  background: rgba(251, 154, 23, 0.1);
  color: #ffc460;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.3px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s;
}

#close-panel:active {
  background: rgba(251, 154, 23, 0.25);
}
