/* The results page, laid over the game when the walk ends. A finger on the map moves the map, so
   the map is a square with room around it, to scroll by. */

#results {
  position: fixed;
  inset: 0;
  z-index: 10;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #0b0b0d;
  color: #ececec;
  font-family: Georgia, "Times New Roman", serif;
}
#results[hidden] { display: none; }

#results-head { padding: 0 16px 12px; }
#results-summary { margin: 0 0 10px; font-size: 17px; opacity: 0.8; text-align: center; }

#results-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; opacity: 0.85; }
#results-legend span::before {
  content: "";
  display: inline-block;
  width: 9px; height: 9px;
  border-radius: 50%;
  margin-right: 6px;
  background: var(--colour);
}
#results-legend .hollow::before { background: none; border: 1.5px solid #aaa; width: 7px; height: 7px; }

/* The map during the walk: over the game, under the opening and results pages. */
#walk-map { position: fixed; inset: 0; z-index: 5; background: #111; }
#walk-map[hidden] { display: none; }

/* The button that goes back to the results page, once it has been seen. */
#walk-end {
  position: absolute;
  left: max(16px, calc(50% - 240px));
  right: max(16px, calc(50% - 240px));
  bottom: calc(28px + env(safe-area-inset-bottom));
  z-index: 1000;
  min-height: 48px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 16px;
  border-radius: 6px;
  border: 1px solid #ececec;
  background: #ececec;
  color: #0b0b0d;
}

/* Where the player is, when the screen does not show them: a round mark with a tip, at the edge
   of the screen. walkmap.js places it and turns it, with the tip, drawn to the right, towards
   them. */
#walk-me {
  position: absolute;
  z-index: 1000;
  width: 44px; height: 44px;
  margin: -22px 0 0 -22px;
  padding: 0;
  border: none;
  background: none;
}
#walk-me[hidden] { display: none; }
#walk-me::before {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 22px; height: 22px;
  margin: -11px 0 0 -11px;
  border-radius: 3px;
  background: #ececec;
  transform: translateX(14px) rotate(45deg);
}
#walk-me::after {
  content: "";
  position: absolute;
  inset: 0;
  box-sizing: border-box;
  border: 3px solid #ececec;
  border-radius: 50%;
  background: radial-gradient(circle, #ffffff 0 6px, #0b0b0d 7px);
}

#results-frame {
  position: relative;
  width: min(calc(100% - 32px), 480px);
  aspect-ratio: 1;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 12px;
}
#results-map { position: absolute; inset: 0; background: #111; }

#results-hint {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  z-index: 1100;
  margin: 0;
  padding: 0 16px;
  transform: translateY(-50%);
  pointer-events: none;
  text-align: center;
  white-space: pre-line;
  font-size: 22px;
  font-weight: bold;
  line-height: 1.3;
  text-shadow: 0 0 6px #0b0b0d, 0 0 6px #0b0b0d, 0 0 12px #0b0b0d;
  animation: results-blink 7.8s ease-in-out infinite;
}
/* 0.4 s in, 2 s shown, 0.4 s out, 5 s gone. */
@keyframes results-blink {
  0% { opacity: 0; }
  5.13%, 30.77% { opacity: 1; }
  35.9%, 100% { opacity: 0; }
}

#results-more { margin: 12px 16px 0; font-size: 15px; line-height: 1.4; text-align: center; }
#results-more[hidden] { display: none; }
#results-buttons {
  box-sizing: border-box;
  display: flex;
  gap: 10px;
  width: min(calc(100% - 32px), 480px);
  margin: 12px auto 0;
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
}
#results-buttons button {
  flex: 1;
  min-height: 48px;
  padding: 6px;
  font: inherit;
  font-size: 16px;
  border-radius: 6px;
  border: 1px solid #ececec;
  background: #ececec;
  color: #0b0b0d;
}

#results-credits { padding: 18px 16px 16px; text-align: center; }
#results-credits h2 { margin: 0 0 10px; font-size: 17px; font-weight: normal; }
#results-credits dl { margin: 0; font-size: 12px; line-height: 1.35; }
#results-credits dt { opacity: 0.6; }
#results-credits dd { margin: 0 0 5px; }
#results-credits p { margin: 8px 0 0; font-size: 12px; opacity: 0.6; }

.results-label { background: none; border: none; box-shadow: none; padding: 0; color: #ececec; font-family: Georgia, "Times New Roman", serif; font-size: 13px; text-shadow: 0 0 4px #0b0b0d, 0 0 4px #0b0b0d; }
.results-label::before { display: none; }

.results-popup .leaflet-popup-content-wrapper,
.results-popup .leaflet-popup-tip { background: rgba(11, 11, 13, 0.95); color: #ececec; box-shadow: 0 2px 14px rgba(0, 0, 0, 0.6); }
.results-popup .leaflet-popup-content-wrapper { border-radius: 8px; }
.results-popup .leaflet-popup-content { margin: 12px 14px; font-family: Georgia, "Times New Roman", serif; }
.results-popup h2 { margin: 0; font-size: 17px; font-weight: normal; }
.results-popup h2 ~ h2 { margin-top: 14px; }
.results-popup small { display: block; margin-top: 2px; font-size: 11px; text-align: right; color: #9a9a9a; }
.results-popup hr { margin: 8px 0; border: none; border-top: 1px solid rgba(236, 236, 236, 0.25); }
.results-popup p { margin: 0 0 8px; font-size: 14px; line-height: 1.45; }
.leaflet-container .leaflet-control-attribution { background: rgba(11, 11, 13, 0.6); color: #888; }
.leaflet-container .leaflet-control-attribution a { color: #aaa; }
