* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: #111;
  color: #000;
  font-family: Arial, Helvetica, sans-serif;
  overflow: hidden;
}

#viewport {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

#stage {
  position: relative;
  width: 600px;
  height: 450px;
  flex: none;
  transform-origin: center center;
  overflow: hidden;
  background: #000;
  box-shadow: 0 0 40px rgba(0, 0, 0, .8);
  user-select: none;
}

.page {
  position: absolute;
  inset: 0;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  animation: fade .2s ease-out;
}

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.obj { position: absolute; }

.obj.text {
  font-size: 13px;
  line-height: 1.3;
  white-space: pre-wrap;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 4px 14px 4px 6px;
  user-select: text;
  scrollbar-width: thin;
  scrollbar-color: #8a7a5c transparent;
}
.obj.text .head { font-weight: bold; }
.obj.text.center { text-align: center; padding: 2px 6px; }

.obj.img { object-fit: fill; }

.link { cursor: pointer; }
.obj.btn { border-radius: 4px; transition: background-color .15s, box-shadow .15s; }
.obj.btn:hover, .obj.btn:focus-visible {
  background: rgba(255, 245, 200, .18);
  box-shadow: 0 0 0 1px rgba(255, 240, 180, .55), 0 0 10px rgba(255, 230, 150, .5);
  outline: none;
}
img.link:hover, img.link:focus-visible {
  outline: 2px solid rgba(255, 235, 160, .9);
  outline-offset: 1px;
}

.obj.combo {
  font: 12px Arial, Helvetica, sans-serif;
  border: 1px solid #6b5d45;
  background: #f4efe2;
  color: #000;
  padding: 0 2px;
}

.obj.video { background: #000; object-fit: contain; }

/* Pop-up pages (photos, abbreviations, music) */
.popup-shade {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .25);
  animation: fade .15s ease-out;
}
.popup {
  position: absolute;
  background-size: 100% 100%;
  box-shadow: 8px 8px 0 rgba(0, 0, 0, .45);
  cursor: pointer;
}
.popup .page { animation: none; }
.popup .obj.text { cursor: auto; }
.popup audio {
  position: absolute;
  left: 50%;
  bottom: 8px;
  transform: translateX(-50%);
  width: 80%;
  height: 28px;
}
.popup .close {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  font-size: 15px;
  line-height: 22px;
  cursor: pointer;
  z-index: 5;
}

#toolbar {
  position: fixed;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 6px;
  z-index: 20;
  opacity: .55;
  transition: opacity .2s;
}
#toolbar:hover { opacity: 1; }
#toolbar button {
  width: 34px;
  height: 34px;
  border: 1px solid #555;
  border-radius: 6px;
  background: #222;
  color: #eee;
  font-size: 17px;
  cursor: pointer;
}
#toolbar button.off { color: #777; text-decoration: line-through; }

#splash {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at center, #3b3226 0%, #120f0b 75%);
  color: #f3e7c9;
  text-align: center;
}
#splash.hidden { display: none; }
.splash-box h1 {
  margin: 0;
  font: bold 56px Georgia, 'Times New Roman', serif;
  color: #e6c35a;
  text-shadow: 2px 2px 0 #5a3f10, 0 0 18px rgba(0, 0, 0, .7);
}
.splash-box .sub { margin: 4px 0 28px; font: italic 22px Georgia, serif; }
.splash-box .note { margin-top: 26px; font-size: 13px; opacity: .7; line-height: 1.5; }
#btn-start {
  padding: 10px 38px;
  font: bold 20px Arial, sans-serif;
  border: 2px solid #e6c35a;
  border-radius: 8px;
  background: #5a3f10;
  color: #fff3cf;
  cursor: pointer;
}
#btn-start:hover { background: #7a5818; }

.intro {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #000;
  object-fit: contain;
  z-index: 10;
}
.skip {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 11;
  padding: 4px 12px;
  border: 1px solid #aaa;
  border-radius: 4px;
  background: rgba(0, 0, 0, .6);
  color: #fff;
  font-size: 12px;
  cursor: pointer;
}
