.street-scene {
  --scene-ratio: 1456 / 819;
  aspect-ratio: var(--scene-ratio);
  overflow: clip;
}

.street-scene:focus {
  outline: none;
}

#tsim-sha-tsui-street {
  display: block;
  width: 100%;
  height: 100%;
  background: #29374b;
  touch-action: manipulation;
  /* 加连威老道街口的「阴天」靠 filter 过渡，进出都不要闪一下 */
  transition: filter .7s ease;
}

#enter-tsim-sha-tsui {
  --x: 35.5%;
  --y: 69%;
  --w: 12.4%;
  --h: 8.3%;
}

#street-balloon:not([hidden]) {
  position: absolute;
  z-index: 1;
  left: var(--marker-x);
  bottom: 9%;
  display: block;
  width: 4.4%;
  padding: 0;
  border: 0;
  background: none;
  transform: translateX(-50%);
  touch-action: manipulation;
}

#street-balloon img {
  display: block;
  width: 100%;
  height: auto;
  transform-origin: center bottom;
  animation: street-balloon-float 3.7s ease-in-out infinite;
}

@media (any-hover: hover) {
  #street-balloon:enabled:hover {
    filter: none;
  }

  #street-balloon:enabled:hover img {
    filter: brightness(1.08);
  }
}

#street-balloon:focus-visible {
  outline: 2px solid #fcffdf;
  outline-offset: 3px;
}

.street-balloon-heart {
  position: absolute;
  top: 16%;
  right: -13%;
  color: #ec84ac;
  text-shadow: 1px 1px #663341;
  font-size: 1.5cqw;
  opacity: 0;
  pointer-events: none;
}

.street-balloon-heart.is-bouncing {
  animation: street-balloon-heart .78s ease-out;
}

@keyframes street-balloon-float {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50% { transform: translateY(-1.05cqw) rotate(3deg); }
}

@keyframes street-balloon-heart {
  0% { opacity: 0; transform: translateY(0) scale(.7); }
  28% { opacity: 1; }
  72% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-1.6cqw) scale(1.05); }
}

@media (prefers-reduced-motion: reduce) {
  #street-balloon img { animation: none; }
  .street-balloon-heart.is-bouncing { opacity: 1; }
}

#street-return-title {
  position: absolute;
  z-index: 1;
  left: 2.1%;
  bottom: 2.4%;
  width: clamp(30px, 4cqw, 46px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  padding: 2px;
  border: 0;
  background: transparent;
  touch-action: manipulation;
}

#street-return-title img {
  width: 100%;
  display: block;
  image-rendering: pixelated;
  pointer-events: none;
}

#street-return-title:hover img { filter: brightness(.88); }

#daybreak {
  position: fixed;
  inset: 0;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 1rem;
  border: 0;
  background: #000;
  text-align: center;
}

#daybreak[open] {
  display: grid;
  place-items: center;
}

#daybreak::backdrop {
  background: transparent;
}

.daybreak-message {
  width: 12.5vw;
  height: auto;
  max-height: 100%;
  object-fit: contain;
}

.street-landmark {
  position: absolute;
  z-index: 1;
  border: 0;
  background: transparent;
  padding: 0;
}
.street-landmark:focus-visible {
  outline: 2px solid #ffda75;
  outline-offset: -3px;
}
.kowloon-park-landmark:focus-visible { outline: none; }
.kowloon-park-landmark:is(:hover, :focus-visible)::after {
  content: "";
  position: absolute;
  inset: 64.8% 61.9% 19.2% 14.2%;
  border: 1px solid #ffc843;
  background: rgb(255 214 112 / 16%);
  box-shadow: 0 0 5px #ffc843;
  pointer-events: none;
}
.avenue-landmark:focus-visible { outline: none; }
.avenue-outline {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0;
  fill: none;
  stroke: #ffe46b;
  stroke-width: 3;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 3px #ffad31);
}
.avenue-landmark:is(:hover, :focus-visible) .avenue-outline { opacity: 1; }

#landmark-video {
  position: fixed;
  inset: 0;
  margin: 0;
  padding: 0;
  border: 0;
  width: 100dvw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  overflow: hidden;
  background: #100e12;
}
#landmark-video::backdrop { background: #100e12; }
#landmark-video video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #100e12;
}
#landmark-video .landmark-close {
  inset: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) auto auto;
  width: clamp(31px, 4vw, 47px);
  border: 2px solid #572a19;
  border-radius: 3px;
  box-shadow: inset 0 0 0 2px #965024, inset 0 3px #fff1c3, 0 2px #401b1a;
}
#landmark-video .landmark-close:hover { filter: brightness(1.15); }
/* The modal is above the page's custom-cursor overlay, so draw the same artwork as a native cursor. */
html #landmark-video, html #landmark-video video {
  cursor: url("../assets/ui/cursor-arrow.png") 1 1, auto !important;
}
#landmark-video .landmark-close {
  cursor: url("../assets/ui/cursor-hand.png") 6 1, pointer !important;
}
.street-landmark { pointer-events: auto; }

.subway-scene {
  --scene-ratio: 16 / 9;
  aspect-ratio: 16 / 9;
  background: #100e12;
}
.subway-scene video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

#street-load-error {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: 5%;
  width: max-content;
  max-width: 85%;
  margin: 0;
  padding: .55em .85em;
  transform: translateX(-50%);
  border: 2px solid #754522;
  background: #ffe7b9;
  color: #593018;
  font: 650 clamp(12px, 2.2cqw, 18px) / 1.4 system-ui, sans-serif;
}

#landmark-video .landmark-close {
  top: auto;
  right: max(12px, env(safe-area-inset-right));
  bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 64;
}

#street-news-sign:not([hidden]) {
  position: absolute;
  z-index: 2;
  left: var(--marker-x);
  bottom: 11.1%;
  width: clamp(24px, 3.4cqw, 50px);
  padding: 0;
  border: 0;
  background: none;
  transform: translateX(-50%);
}
#street-news-sign img { display: block; width: 100%; }
#street-news-sign:hover { filter: brightness(1.18); }
.street-balloon-guide {
  opacity: 0;
  position: absolute;
  left: 50%;
  bottom: 102%;
  width: 84%;
  aspect-ratio: 1;
  background: url("../assets/ui/guide-down.png") center / contain no-repeat;
  transform: translateX(-50%);
  pointer-events: none;
}
/* Start the arrow after the street's .7s sky transition. */
.show-guide .street-balloon-guide {
  opacity: 1;
  transition: opacity .18s ease .7s;
  animation: street-guide-bob 1.9s ease-in-out .7s infinite alternate;
}
@keyframes street-guide-bob {
  from { transform: translate(-50%, -26%); }
  to { transform: translate(-50%, 5%); }
}

#street-news {
  width: min(460px, 90vw, 82dvh);
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
}
#street-news::backdrop { background: rgb(22 19 35 / 54%); }
.street-news-edition {
  position: relative;
  aspect-ratio: 495 / 410;
  container-type: inline-size;
  background: url("../assets/ui/street-news-paper.webp?v=2") center / 100% 100% no-repeat;
  color: #462417;
}
.street-news-header :is(.street-news-title, .street-news-motto, .street-news-issue, .street-news-kicker) {
  position: absolute;
  margin: 0;
  line-height: 1.1;
}
.street-news-title {
  top: 15%;
  left: 9.3%;
  font: 900 clamp(16px, 7.6cqw, 38px) / 1.1 "Songti SC", "Noto Serif CJK TC", serif;
  letter-spacing: .08em;
  color: #fff1cd;
  text-shadow: 1px 2px #772c1e;
}
.street-news-kicker {
  top: 5%;
  left: 7%;
  transform: rotate(-9deg);
  font-size: clamp(9px, 3.2cqw, 16px);
  font-weight: 850;
}
.street-news-issue {
  top: 14%;
  right: 8%;
  font-size: clamp(8px, 2.15cqw, 11px);
  text-align: right;
  font-weight: 700;
}
.street-news-motto {
  top: 27.6%;
  left: 50%;
  transform: translateX(-50%);
  font-size: clamp(8px, 2.6cqw, 13px);
  font-weight: 750;
  white-space: nowrap;
}
.street-news-close {
  position: absolute;
  left: 91.5%;
  top: 2.8%;
  width: 8%;
  height: 10%;
  padding: 0;
  border: 0;
  background: transparent;
}
.street-news-stories {
  position: absolute;
  inset: 31.5% 7.1% 7.1% 7.8%;
  display: grid;
  grid-template-rows: repeat(4, minmax(0, 1fr));
}
.street-news-story {
  display: grid;
  grid-template-columns: 24% minmax(0, 1fr);
  align-items: center;
  gap: 3%;
  padding: 0 1.4%;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.street-news-story:hover { background: rgb(255 239 176 / 30%); }
.street-news-story:focus-visible, .street-news-close:focus-visible {
  outline: 2px solid #a32f23;
  outline-offset: -2px;
}
.street-news-thumb {
  display: block;
  height: 82%;
  border-radius: 5px;
  background: url("../assets/ui/street-news-thumbnails.webp") 50% 0 / 100% 400% no-repeat;
}
.street-news-story:nth-child(2) .street-news-thumb { background-position-y: 33.333%; }
.street-news-story:nth-child(3) .street-news-thumb { background-position-y: 66.667%; }
.street-news-story:nth-child(4) .street-news-thumb { background-position-y: 100%; }
.street-news-copy { display: grid; justify-items: start; gap: 2px; }
.street-news-category {
  padding: 1px .5em;
  border-radius: 4px;
  background: #a13d31;
  color: #fff3d9;
  font-size: clamp(8px, 2.3cqw, 11px);
  font-weight: 700;
  line-height: 1.05;
}
.street-news-copy strong {
  font-size: clamp(9px, 3.2cqw, 15px);
  line-height: 1.15;
  font-weight: 800;
}
.street-news-tip {
  position: absolute;
  bottom: 7%;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  padding: .5em 1em;
  border: 2px solid #8a4225;
  background: #ffe6ac;
  box-shadow: 2px 3px 0 #69331aba;
  color: #502915;
  font-weight: 750;
  white-space: nowrap;
  pointer-events: none;
}
@media (prefers-reduced-motion: reduce) {
  .show-guide .street-balloon-guide { animation: none; }
}

/* The artwork is painted behind the player on the scrolling canvas. */
#street-news-sign img { opacity: 0; }
#office-arrival-audio, #office-arrival-play {
  position: absolute;
  z-index: 1;
  padding: .4em .8em;
  border: 2px solid #804216;
  border-radius: 5px;
  background: #ffdf9b;
  color: #522b15;
  font: 750 clamp(12px, 2cqw, 18px) system-ui, sans-serif;
}
#office-arrival-audio { top: 3%; right: 3%; }
#office-arrival-play { top: 50%; left: 50%; transform: translate(-50%, -50%); }

#street-news-sign:is(:hover, :focus-visible) {
  border-radius: 3px;
  box-shadow: 0 0 0 2px #ffe9a8, 0 0 18px 4px rgb(255 205 92 / 72%);
  animation: l4-sign-pulse 1.1s steps(2, end) infinite;
}
@media (prefers-reduced-motion: reduce) {
  #street-news-sign:is(:hover, :focus-visible) { animation: none; }
}

#office-arrival-audio, #office-arrival-skip {
  position: absolute;
  z-index: 1;
  padding: .25em .65em;
  border: 2px solid #804216;
  border-radius: 4px;
  background: #ffdf9b;
  color: #522b15;
  font: 750 clamp(11px, 1.35vw, 15px) system-ui, sans-serif;
}
#office-arrival-skip { right: 3%; bottom: 3%; }
