:root {
  --ink: #171918;
  --paper: #f4f1e8;
  --red: #e34b36;
  --yellow: #f2c84b;
  --teal: #2a7472;
  --sky: #8bb7bf;
  --topbar-height: 68px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  background: #17211e;
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  letter-spacing: 0;
}

button,
a,
input {
  font: inherit;
}

a {
  color: inherit;
}

.map-topbar {
  align-items: center;
  background: var(--paper);
  border-bottom: 2px solid var(--ink);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  height: var(--topbar-height);
  left: 0;
  padding: 0 24px;
  position: fixed;
  right: 0;
  top: 0;
  z-index: 30;
}

.map-home,
.map-github {
  align-items: center;
  border: 0;
  display: inline-flex;
  font-size: 12px;
  font-weight: 700;
  gap: 9px;
  text-decoration: none;
  width: max-content;
}

.map-home:hover,
.map-home:focus-visible,
.map-github:hover,
.map-github:focus-visible {
  color: var(--red);
}

.map-title {
  text-align: center;
}

.map-title strong {
  display: block;
  font-family: "STSong", "Songti SC", SimSun, serif;
  font-size: 20px;
}

.map-title span {
  color: #66635c;
  display: block;
  font: 9px Georgia, serif;
  margin-top: 2px;
}

.map-tools {
  align-items: center;
  display: flex;
  gap: 18px;
  justify-content: flex-end;
}

.film-count {
  color: #66635c;
  font-size: 11px;
}

.film-count strong {
  color: var(--ink);
  font: 700 16px Georgia, serif;
}

.sound-switch {
  align-items: center;
  cursor: pointer;
  display: flex;
  font-size: 11px;
  gap: 7px;
}

.sound-switch input {
  height: 1px;
  opacity: 0;
  position: absolute;
  width: 1px;
}

.switch-track {
  background: #b9b7af;
  border: 1px solid var(--ink);
  display: block;
  height: 18px;
  padding: 2px;
  transition: background .2s ease;
  width: 34px;
}

.switch-track span {
  background: var(--ink);
  display: block;
  height: 12px;
  transform: translateX(0);
  transition: transform .2s ease;
  width: 12px;
}

.sound-switch input:checked + .switch-track {
  background: var(--yellow);
}

.sound-switch input:checked + .switch-track span {
  transform: translateX(14px);
}

.sound-switch input:focus-visible + .switch-track {
  outline: 3px solid var(--red);
  outline-offset: 2px;
}

.map-viewport {
  bottom: 0;
  left: 0;
  overflow: hidden;
  position: fixed;
  right: 0;
  top: var(--topbar-height);
}

.photo-world {
  background: #cdd6c0;
  height: 1080px;
  left: 0;
  position: absolute;
  top: 0;
  transform: translate3d(0, 0, 0);
  width: 1800px;
  will-change: transform;
}

.photo-world::before,
.photo-world::after {
  border: 2px solid rgba(23, 25, 24, .2);
  content: "";
  position: absolute;
}

.photo-world::before {
  background: #8bb7bf;
  height: 390px;
  left: 1060px;
  top: -110px;
  transform: rotate(-8deg);
  width: 690px;
}

.photo-world::after {
  background: #d9d0b7;
  bottom: -150px;
  height: 440px;
  left: -100px;
  transform: rotate(5deg);
  width: 720px;
}

.map-road {
  border: 4px dashed rgba(23, 25, 24, .34);
  border-left: 0;
  border-right: 0;
  height: 150px;
  position: absolute;
  transform: rotate(-12deg);
  width: 1550px;
  z-index: 1;
}

.road-a {
  left: 110px;
  top: 410px;
}

.road-b {
  left: 210px;
  top: 700px;
  transform: rotate(8deg);
  width: 1280px;
}

.zone-label {
  color: rgba(23, 25, 24, .34);
  font-family: "STSong", "Songti SC", SimSun, serif;
  font-size: 58px;
  font-weight: 700;
  margin: 0;
  position: absolute;
  z-index: 1;
}

.zone-city {
  left: 84px;
  top: 90px;
}

.zone-nature {
  right: 110px;
  top: 95px;
}

.zone-memory {
  bottom: 92px;
  right: 160px;
}

.landmark {
  background: var(--paper);
  border: 2px solid var(--ink);
  color: var(--ink);
  display: block;
  height: 136px;
  padding: 7px;
  position: absolute;
  text-decoration: none;
  transform: translate(-50%, -50%) rotate(var(--tilt));
  transition: transform .2s ease, box-shadow .2s ease;
  width: 150px;
  z-index: 5;
}

.landmark:nth-child(3n) {
  --accent: var(--red);
}

.landmark:nth-child(3n + 1) {
  --accent: var(--teal);
}

.landmark:nth-child(3n + 2) {
  --accent: #bd8b14;
}

.landmark:hover,
.landmark:focus-visible,
.landmark.is-near {
  box-shadow: 9px 10px 0 rgba(23, 25, 24, .23);
  transform: translate(-50%, -50%) rotate(0) scale(1.07);
  z-index: 12;
}

.landmark:focus-visible {
  outline: 4px solid var(--yellow);
  outline-offset: 2px;
}

.landmark img {
  background: #1d2422;
  display: block;
  height: 88px;
  object-fit: cover;
  width: 100%;
}

.landmark-label {
  align-items: baseline;
  border-top: 4px solid var(--accent);
  display: flex;
  gap: 5px;
  justify-content: space-between;
  padding-top: 5px;
}

.landmark-label strong {
  font-family: "STSong", "Songti SC", SimSun, serif;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.landmark-label span {
  color: #69665f;
  flex: none;
  font-size: 8px;
}

.player {
  height: 132px;
  left: 210px;
  pointer-events: none;
  position: absolute;
  top: 540px;
  transform: translate(-50%, -78%);
  width: 106px;
  z-index: 20;
}

.player img {
  animation: player-idle 1.9s ease-in-out infinite;
  display: block;
  height: 132px;
  position: relative;
  width: 106px;
  z-index: 2;
}

.player.is-moving img {
  animation: player-walk .28s ease-in-out infinite alternate;
}

.player.is-left img {
  transform: scaleX(-1);
}

.player-shadow {
  background: rgba(23, 25, 24, .28);
  bottom: -7px;
  height: 14px;
  left: 22px;
  position: absolute;
  transform: skewX(-12deg);
  width: 67px;
  z-index: 1;
}

@keyframes player-idle {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -4px; }
}

@keyframes player-walk {
  from { translate: 0 -2px; rotate: -2deg; }
  to { translate: 0 2px; rotate: 2deg; }
}

.film {
  background: #252a28;
  border: 3px solid var(--paper);
  box-shadow: 0 0 0 2px var(--ink);
  height: 34px;
  position: absolute;
  transform: translate(-50%, -50%);
  transition: opacity .2s ease, transform .2s ease;
  width: 46px;
  z-index: 4;
}

.film::before {
  background: var(--yellow);
  content: "";
  height: 10px;
  left: 8px;
  position: absolute;
  top: 9px;
  width: 24px;
}

.film::after {
  border-bottom: 3px dotted var(--paper);
  border-top: 3px dotted var(--paper);
  content: "";
  inset: 3px;
  position: absolute;
}

.film.is-collected {
  opacity: 0;
  transform: translate(-50%, -80%) scale(.4);
}

.nearby-panel {
  background: var(--paper);
  border: 2px solid var(--ink);
  bottom: 24px;
  display: grid;
  gap: 4px;
  left: 24px;
  max-width: 300px;
  min-height: 112px;
  padding: 15px 17px;
  position: fixed;
  width: calc(100% - 48px);
  z-index: 25;
}

.nearby-panel::before {
  background: var(--red);
  content: "";
  height: 100%;
  left: 0;
  position: absolute;
  top: 0;
  width: 5px;
}

.nearby-index {
  color: var(--red);
  font: 9px Georgia, serif;
  text-transform: uppercase;
}

.nearby-panel strong {
  font-family: "STSong", "Songti SC", SimSun, serif;
  font-size: 18px;
}

.nearby-panel > span:not(.nearby-index) {
  color: #6d6a63;
  font-size: 10px;
}

.nearby-panel a {
  background: var(--ink);
  color: #fff;
  font-size: 11px;
  justify-self: start;
  margin-top: 4px;
  padding: 7px 10px;
  text-decoration: none;
}

.move-pad {
  bottom: 24px;
  display: grid;
  gap: 4px;
  grid-template-areas: ". up ." "left down right";
  grid-template-columns: repeat(3, 46px);
  position: fixed;
  right: 24px;
  z-index: 25;
}

.move-pad button {
  background: rgba(244, 241, 232, .94);
  border: 2px solid var(--ink);
  border-radius: 0;
  color: var(--ink);
  cursor: pointer;
  font-size: 20px;
  height: 46px;
  padding: 0;
  touch-action: none;
  width: 46px;
}

.move-pad button:hover,
.move-pad button:focus-visible,
.move-pad button.is-active {
  background: var(--yellow);
  outline: none;
}

.move-pad [data-move="up"] { grid-area: up; }
.move-pad [data-move="left"] { grid-area: left; }
.move-pad [data-move="down"] { grid-area: down; }
.move-pad [data-move="right"] { grid-area: right; }

@media (max-width: 720px) {
  :root {
    --topbar-height: 104px;
  }

  .map-topbar {
    grid-template-columns: auto 1fr;
    height: var(--topbar-height);
    padding: 12px 14px;
  }

  .map-title {
    text-align: right;
  }

  .map-tools {
    border-top: 1px solid #cbc7bc;
    gap: 12px;
    grid-column: 1 / -1;
    justify-content: space-between;
    padding-top: 8px;
  }

  .map-github {
    font-size: 11px;
  }

  .photo-world {
    height: 1480px;
    width: 1180px;
  }

  .zone-label {
    font-size: 42px;
  }

  .zone-nature {
    right: 60px;
    top: 410px;
  }

  .zone-memory {
    bottom: 110px;
    right: 70px;
  }

  .nearby-panel {
    bottom: 18px;
    left: 14px;
    max-width: 190px;
    min-height: 106px;
    padding: 12px 12px 12px 16px;
    width: calc(100% - 174px);
  }

  .nearby-panel strong {
    font-size: 15px;
  }

  .move-pad {
    bottom: 18px;
    gap: 3px;
    grid-template-columns: repeat(3, 42px);
    right: 14px;
  }

  .move-pad button {
    height: 42px;
    width: 42px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
