/* Gameficate cartridge — media: the "Getting the game ready…" screen (js/ui/LoadingScreen.js) and fun facts with
   text, HTML, pictures, sound, video and PDFs (js/media/FunFact.js). */

/* ---------- Getting the game ready ---------- */
.asset-loader {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(4px);
  transition: opacity 0.3s;
}
.asset-loader.out {
  opacity: 0;
  pointer-events: none;
}
.al-card {
  width: 720px;
  max-width: calc(100% - 40px);
  padding: 40px 48px 36px;
  border-radius: calc(28px * var(--rs, 1));
  background: var(--card);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.18);
  text-align: center;
}
.al-card h2 {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 800;
  color: var(--navy);
}
.al-sub {
  margin-top: 8px;
  font-size: 19px;
  font-weight: 700;
  color: var(--muted);
  line-height: 1.45;
}
.al-bar {
  height: 18px;
  margin: 28px 0 12px;
  border-radius: 999px;
  background: var(--soft3);
  overflow: hidden;
}
.al-bar span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--green));
  transition: width 0.25s;
}
.al-count {
  font-size: 18px;
  font-weight: 800;
  color: var(--ink);
}
.al-problem {
  margin-top: 22px;
  padding: 18px 20px;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--red) 9%, var(--card));
  border: 2px solid color-mix(in srgb, var(--red) 35%, var(--card));
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  text-align: left;
}
.al-problem ul {
  margin: 8px 0 0 22px;
  font-weight: 600;
  color: var(--muted);
  word-break: break-all;
}
.al-acts {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 16px;
}

/* ---------- ✨ Fun fact button in the feedback card ---------- */
.feedback .f-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 10px 0 0 10px;
  padding: 5px 16px;
  border-radius: calc(999px * var(--rs, 1));
  background: color-mix(in srgb, var(--gold) 30%, var(--card));
  border: 2px solid var(--gold);
  color: var(--navy);
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
}
.feedback .f-more:hover,
.feedback .f-more:focus-visible {
  background: var(--gold);
}

/* ---------- The fun fact window ---------- */
.ff-modal {
  text-align: left;
}
.modal .ff-modal h2.ff-title {
  font-size: 34px;
  margin: 0 56px 14px 0;
}
.ff-text {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.55;
  color: var(--ink);
}
.ff-text p + p,
.ff-html > * + * {
  margin-top: 10px;
}
.ff-html ul,
.ff-html ol {
  padding-left: 28px;
}
.ff-html a {
  color: var(--link);
  font-weight: 800;
}
.ff-html img,
.ff-html video {
  max-width: 100%;
  border-radius: var(--radius);
}
.ff-html table {
  border-collapse: collapse;
}
.ff-html th,
.ff-html td {
  border: 1px solid var(--line);
  padding: 4px 10px;
}
.ff-media {
  margin: 18px 0 0;
}
.ff-media figcaption {
  margin-top: 6px;
  font-size: 16px;
  font-weight: 700;
  color: var(--muted);
}
.ff-media img,
.ff-media video {
  display: block;
  max-width: 100%;
  max-height: 520px;
  margin: 0 auto;
  border-radius: var(--radius);
  background: var(--soft);
}
.ff-media audio {
  width: 100%;
}
.ff-pdf-view,
.ff-embed {
  display: block;
  width: 100%;
  height: 480px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--soft2);
}
.ff-embed {
  height: auto;
  aspect-ratio: 16 / 9;
}
.ff-open {
  display: inline-block;
  margin-top: 10px;
  font-size: 17px;
  font-weight: 800;
  color: var(--link);
}
.ff-online {
  display: block;
  margin-top: 6px;
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
}

/* In a pop-up a picture or video never needs more than the screen has. */
.modal .ff-media img,
.modal .ff-media video {
  max-height: min(520px, calc(var(--stage-h, 1080px) - 300px));
}
.modal .ff-pdf-view {
  height: min(480px, calc(var(--stage-h, 1080px) - 300px));
}
