:root {
  --ink: #1d1836;
  --bg: #211839;      /* the page behind the picture: the same colour as the background of the tiles, rgb(33,24,57) */
  --ivory: #fff3e2;
  --gold: #ffd49a;
  --panel: rgba(29, 24, 54, 0.72);
  --line: rgba(255, 243, 226, 0.22);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--bg);
  color: var(--ivory);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

#app {
  position: fixed;
  inset: 0;
  background: var(--bg);
}

#lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#map {
  position: absolute;
  inset: 0;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

/* ---- title */
.top {
  position: absolute;
  left: 0; right: 0; top: 0;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) calc(env(safe-area-inset-right, 0px) + 16px) 26px calc(env(safe-area-inset-left, 0px) + 16px);
  background: linear-gradient(rgba(29, 24, 54, 0.78), rgba(29, 24, 54, 0.42) 62%, rgba(29, 24, 54, 0));
  pointer-events: none;
}
.top h1 {
  margin: 0;
  font-size: 19px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-shadow: 0 1px 2px rgba(29, 24, 54, 0.8);
}
.top h1 span { font-weight: 400; color: var(--gold); white-space: nowrap; }
.top p {
  margin: 3px 0 0;
  font-size: 13px;
  line-height: 1.3;
  opacity: 0.92;
  text-shadow: 0 1px 2px rgba(29, 24, 54, 0.8);
}

/* ---- zoom buttons */
.zoom {
  position: absolute;
  right: calc(env(safe-area-inset-right, 0px) + 12px);
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.zoom button {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ivory);
  font: 400 24px/1 inherit;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.zoom button:active { background: rgba(255, 212, 154, 0.35); }

/* ---- hint */
.hint {
  position: absolute;
  left: 50%; top: 21%;
  width: max-content;
  max-width: calc(100% - 32px);
  transform: translate(-50%, -50%);
  margin: 0;
  padding: 9px 16px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--line);
  font-size: 14px;
  white-space: normal;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
}
.hint.show { opacity: 1; }

/* ---- bottom: jump chips + footer */
.bottom {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding-top: 28px;
  background: linear-gradient(rgba(29, 24, 54, 0), rgba(29, 24, 54, 0.62) 34%, rgba(29, 24, 54, 0.9));
  pointer-events: none;
}
.jump {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 calc(env(safe-area-inset-right, 0px) + 16px) 10px calc(env(safe-area-inset-left, 0px) + 16px);
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
  pointer-events: auto;
}
.jump::-webkit-scrollbar { display: none; }
.jump button {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ivory);
  font: 500 14px/1 inherit;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.jump button:active, .jump button.on { background: rgba(255, 212, 154, 0.32); border-color: var(--gold); }
.jump button.toggle::before { content: ""; display: inline-block; width: 9px; height: 9px; margin-right: 7px; border-radius: 50%; border: 1.5px solid var(--ivory); vertical-align: 0; }
.jump button.toggle.on2::before { background: var(--gold); border-color: var(--gold); }
.jump button[hidden] { display: none; }
/* the two layer switches use a short word on narrow phones, so that the first place chip stays in sight */
.jump button .sm { display: none; }
@media (max-width: 479px) {
  .jump button .lg { display: none; }
  .jump button .sm { display: inline; }
}

footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 calc(env(safe-area-inset-right, 0px) + 16px) calc(env(safe-area-inset-bottom, 0px) + 12px) calc(env(safe-area-inset-left, 0px) + 16px);
  touch-action: none;
  pointer-events: auto;
}
.cta {
  display: block;
  padding: 13px 16px;
  border-radius: 12px;
  background: var(--gold);
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}
.cta:active { filter: brightness(0.93); }
.credit {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.4;
  opacity: 0.86;
}
.credit a { color: inherit; }
.zoom #zall { font-size: 20px; }
.credit .by { color: var(--gold); font-weight: 600; white-space: nowrap; margin-left: 4px; }

.noscript { position: fixed; inset: 40% 16px auto; text-align: center; }

a:focus-visible, button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* wider screens: footer in one row */
@media (min-width: 760px) {
  .top h1 { font-size: 24px; }
  .top p { font-size: 14px; }
  .top { padding-left: 24px; padding-top: 16px; }
  .jump { padding-left: 24px; padding-right: 24px; }
  footer { flex-direction: row; align-items: center; gap: 18px; padding-left: 24px; padding-right: 24px; padding-bottom: 16px; }
  .cta { flex: 0 0 auto; padding: 12px 22px; }
  .credit { font-size: 12.5px; }
}

/* short landscape phones: keep the picture visible */
@media (max-height: 460px) {
  .top { padding-top: calc(env(safe-area-inset-top, 0px) + 8px); padding-bottom: 16px; }
  .top h1 { font-size: 16px; }
  .top p { font-size: 12px; }
  .bottom { padding-top: 16px; }
  .jump { padding-bottom: 6px; }
  .jump button { min-height: 32px; font-size: 13px; }
  footer { flex-direction: row; align-items: center; gap: 12px; padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 8px); }
  .cta { flex: 0 0 auto; padding: 8px 14px; font-size: 14px; }
  .credit { font-size: 10.5px; }
}

@media (prefers-reduced-motion: reduce) {
  .hint { transition: none; }
}
