*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: #fff;
  color: #202122;
  overflow: hidden;
}

#stage {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px 16px 120px;
}

/* Wikipedia-style thumbnail frame */
.thumb {
  display: block;
  text-decoration: none;
  color: inherit;
  opacity: 0;
  transition: opacity 0.7s ease;
  cursor: pointer;
  max-width: min(440px, 100%);
}
.thumb.show { opacity: 1; }

.thumbinner {
  border: 1px solid #c8ccd1;
  background: #f8f9fa;
  padding: 3px;
}
.thumbinner img {
  display: block;
  width: 100%;
  max-height: 52vh;
  object-fit: cover;
  border: 1px solid #c8ccd1;
  background: #fff;
}
.thumbcaption {
  position: relative;
  padding: 5px 26px 4px 3px;
  font-family: -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  color: #202122;
}
.thumbcaption a, .thumbcaption .link { color: #3366cc; }

/* the little "enlarge" icon in the corner */
.magnify {
  position: absolute;
  right: 4px;
  top: 7px;
  width: 15px;
  height: 11px;
}
.magnify::before, .magnify::after {
  content: "";
  position: absolute;
  border: 1px solid #72777d;
  background: #fff;
}
.magnify::before { left: 0; bottom: 0; width: 9px; height: 7px; }
.magnify::after  { right: 0; top: 0; width: 9px; height: 7px; background: transparent; }

/* bottom-right "Loading …" */
.loading {
  position: fixed;
  right: max(16px, 6vw);
  bottom: max(20px, 6vh);
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "Linux Libertine", "Libertinus Serif", Georgia, "Times New Roman", serif;
  font-size: clamp(26px, 3.4vw, 40px);
  color: #2a4b8d;
  user-select: none;
}
.globe {
  width: 1.15em;
  height: 1.15em;
  object-fit: contain;
}
.dots { letter-spacing: 0.15em; margin-left: 2px; }
.dots i {
  font-style: normal;
  opacity: 0.15;
  animation: dot 1.6s infinite;
}
.dots i:nth-child(2) { animation-delay: 0.25s; }
.dots i:nth-child(3) { animation-delay: 0.5s; }
@keyframes dot {
  0%, 20%  { opacity: 0.15; }
  40%, 70% { opacity: 1; }
  100%     { opacity: 0.15; }
}

/* bottom-left "?" tip */
.tip {
  position: fixed;
  left: max(12px, 2vw);
  bottom: max(20px, 6vh);
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  font-family: "Linux Libertine", "Libertinus Serif", Georgia, "Times New Roman", serif;
  font-size: clamp(17px, 2vw, 26px);
  line-height: 1.05;
  color: #1a8cf0;
}
.tip-icon { height: 2.1em; width: auto; flex: none; }
.tip-text {
  max-width: 13em;
  text-align: center;
  opacity: 0;
  transition: opacity 0.8s ease;
}
.tip-text.show { opacity: 1; }
.tip:hover .tip-text { text-decoration: underline; }

.controls {
  position: fixed;
  top: 14px;
  right: 14px;
  display: flex;
  gap: 8px;
}
.sound {
  width: 34px;
  height: 34px;
  border: 1px solid #c8ccd1;
  border-radius: 50%;
  background: #fff;
  color: #72777d;
  font-size: 16px;
  cursor: pointer;
  opacity: 0.6;
}
.sound:hover { opacity: 1; }
.sound.off { text-decoration: line-through; }

.hint {
  position: fixed;
  top: 20px;
  left: 0;
  right: 0;
  text-align: center;
  font: 13px -apple-system, Helvetica, Arial, sans-serif;
  color: #a2a9b1;
  transition: opacity 1s;
  pointer-events: none;
}
.hint.gone { opacity: 0; }

@media (max-width: 700px) {
  #stage { padding-bottom: 170px; }
  .tip { bottom: calc(max(20px, 6vh) + 56px); right: 16px; }
  .tip-text { max-width: none; text-align: left; }
  .thumbcaption { font-size: 13px; }
}

/* Netlify's injected "Powered by Netlify" badge */
#nl-badge-frame { display: none !important; }
