/* The opening page: the words float over a map that does not move. */

#opening {
  position: fixed;
  inset: 0;
  z-index: 10;
  background: #0b0b0d;
  color: #ececec;
  font-family: Georgia, "Times New Roman", serif;
}
#opening[hidden] { display: none; }

#opening-map { position: absolute; inset: 0; z-index: 0; background: #111; }

/* Every touch lands here: fingers scroll the conversation and never reach the map. */
#opening-talk {
  position: absolute;
  inset: 0;
  z-index: 1;
  box-sizing: border-box;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  /* On a computer the words keep to a phone-wide column in the middle of the screen. */
  padding: 54px max(16px, calc(50% - 240px)) calc(24px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  /* The map behind is busy: a dark blur, built up in layers, lifts the words off it. */
  text-shadow:
    0 0 2px rgba(0, 0, 0, 0.5),
    0 0 4px rgba(0, 0, 0, 0.5),
    0 0 8px rgba(0, 0, 0, 0.5),
    0 0 8px rgba(0, 0, 0, 0.5),
    0 0 16px rgba(0, 0, 0, 0.5),
    0 0 16px rgba(0, 0, 0, 0.5);
}

/* Stays at the top while the words scroll under it. */
#opening-languages {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 2;
  display: flex;
  gap: 14px;
  padding: 12px max(16px, calc(50% - 240px)) 14px;
  background: linear-gradient(rgba(11, 11, 13, 0.85) 60%, rgba(11, 11, 13, 0));
  pointer-events: none;
}
#opening-languages button {
  padding: 4px 0;
  border: none;
  border-bottom: 1px solid transparent;
  background: none;
  color: #ececec;
  font: inherit;
  font-size: 14px;
  opacity: 0.6;
  pointer-events: auto;
}
#opening-languages button.chosen { opacity: 1; border-bottom-color: #ececec; }

/* opening.js sets each line's size, so that it fills the width. */
#opening h1 { flex: none; margin: 0 0 20px; font-weight: bold; line-height: 1.12; white-space: nowrap; }
#opening h1 span { display: table; }

#opening p { flex: none; margin: 0 0 16px; font-size: 24px; line-height: 1.35; animation: opening-appear 0.5s ease-out; }
#opening p.old { animation: none; }
#opening p.katarina { margin-right: 2ch; color: #ff86b0; }
#opening p.player { margin-left: 2ch; color: #ffffff; text-align: right; }
@keyframes opening-appear { from { opacity: 0; transform: translateY(8px); } }

#opening button.answer {
  flex: none;
  align-self: center;
  margin: 4px 2ch 0;
  padding: 12px 18px;
  min-height: 48px;
  font: inherit;
  font-size: 19px;
  border-radius: 6px;
  border: 1px solid #ececec;
  background: #ececec;
  color: #0b0b0d;
  text-shadow: none;
}
#opening button.answer:disabled { opacity: 0.6; }
#opening button.answer + button.answer { margin-top: 12px; }
#opening button.answer.quiet { background: none; color: #ececec; text-shadow: inherit; }

/* On the way to the start the words stay at the top and the button at the bottom, and fingers
   reach the map. opening.js moves the last words down, to just under the end. */
#opening-talk.on-map { pointer-events: none; }
#opening-talk.on-map button { pointer-events: auto; }
#opening-talk.on-map button.answer { margin-top: auto; }

.opening-blink { animation: opening-blink 1.4s ease-in-out infinite; }
@keyframes opening-blink { 50% { opacity: 0.25; } }
