/* NusaIQ Module Layer — progress, missions, collection, combo */

/*
 * Readability floors owned by the shared module source.
 *
 * Every consumer of NusaIQModule renders the same panel markup, so the floors
 * belong here rather than in each game. `--eml-text` is the 16px meaningful-text
 * floor; `--eml-target` is the 44px interactive-target floor. Decorative marks
 * (collection icons, the combo flourish) are deliberately larger and are not
 * governed by the floor.
 */
:root {
  --eml-text: 1rem; /* 16px meaningful-text floor */
  --eml-text-heading: 1.05rem;
  --eml-target: 44px;
}

.eml-panel {
  /*
   * Opaque on purpose. A translucent surface composites the page behind every
   * label inside the panel, so the same ink measures a different contrast ratio
   * in each game. A solid surface makes panel contrast deterministic.
   */
  background: #ffffff;
  border-radius: 16px;
  padding: 12px 14px;
  margin: 10px 0 14px;
  text-align: left;
  font-family: "Nunito", system-ui, sans-serif;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.06);
}
.eml-panel h4 {
  margin: 0 0 8px;
  font-size: var(--eml-text-heading);
  color: #1b4332;
}
.eml-progress {
  margin: 8px 0 12px;
  font-family: "Nunito", system-ui, sans-serif;
}
.eml-progress-top {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  justify-content: space-between;
  font-size: var(--eml-text);
  font-weight: 800;
  color: #264653;
  margin-bottom: 4px;
}
.eml-progress-bar {
  height: 10px;
  background: #e8f0eb;
  border-radius: 999px;
  overflow: hidden;
}
.eml-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #52b788, #2d6a4f);
  border-radius: 999px;
  transition: width 0.4s ease;
}
.eml-missions ol,
.eml-mission-list {
  margin: 0;
  padding-left: 1.1rem;
  font-size: var(--eml-text);
  font-weight: 700;
  color: #37474f;
}
.eml-mission-list li {
  margin: 4px 0;
}
.eml-mission-list li.done {
  color: #2d6a4f;
}
/* Supporting copy stays de-emphasised, but at readable size and AA ink. */
.eml-mission-desc {
  font-weight: 600;
  color: #546e7a;
  font-size: var(--eml-text);
}
.eml-collect-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
@media (min-width: 480px) {
  .eml-collect-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
/*
 * Locked collection cards read as locked through their own surface, border and
 * lock glyph — never through a whole-card `opacity`, which would fade the card
 * label along with the artwork and drop its contrast below WCAG AA.
 */
.eml-collect-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: var(--eml-target);
  min-width: var(--eml-target);
  border: 2px solid #8a9199;
  background: #f1f3f5;
  border-radius: 12px;
  padding: 8px 4px;
  text-align: center;
  cursor: pointer;
  font-family: inherit;
}
.eml-collect-card.on {
  border-color: #2d6a4f;
  background: #e8f5e9;
}
.eml-collect-icon {
  display: block;
  font-size: 1.25rem;
  line-height: 1.2;
}
.eml-collect-card small {
  display: block;
  font-size: var(--eml-text);
  line-height: 1.3;
  font-weight: 800;
  color: #37474f;
  margin-top: 2px;
  /* Long collection names must wrap inside a narrow 320px column, never widen it. */
  overflow-wrap: anywhere;
}
.eml-mode-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 10px 0;
}
.eml-mode-row button {
  flex: 1 1 130px;
  min-height: var(--eml-target);
  min-width: var(--eml-target);
  border: none;
  border-radius: 999px;
  padding: 12px 14px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  font-size: var(--eml-text);
}
.eml-mode-row .eml-btn-learn {
  background: #e3f2fd;
  color: #1565c0;
}
/* Darkened so white label ink clears AA against the lightest stop of the fill. */
.eml-mode-row .eml-btn-quiz {
  background: linear-gradient(135deg, #2d6a4f, #1b4332);
  color: #fff;
}
.eml-combo {
  position: fixed;
  top: 16%;
  left: 50%;
  transform: translateX(-50%) scale(0.7);
  z-index: 9600;
  font-family: "Nunito", system-ui, sans-serif;
  font-weight: 900;
  font-size: 1.5rem;
  color: #e65100;
  text-shadow: 0 2px 0 #fff;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.25s ease;
}
.eml-combo.show {
  opacity: 1;
  transform: translateX(-50%) scale(1.1);
}
.eml-combo.ultra {
  color: #c62828;
  font-size: 1.75rem;
}
.eml-toast {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9700;
  background: #1b4332;
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 800;
  font-family: "Nunito", system-ui, sans-serif;
  font-size: var(--eml-text);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}
.eml-hud-combo {
  font-size: var(--eml-text);
  font-weight: 800;
  color: #bf360c;
  min-width: 4em;
  text-align: center;
}
/*
 * A locked planet dims its artwork, not the whole card. Fading the card would
 * fade its label with it, and the label is the only text that says which planet
 * is still locked.
 */
.planet-card.eml-locked .planet-img-wrapper {
  opacity: 0.45;
  filter: grayscale(0.7);
}
.planet-card.eml-unlocked-new {
  animation: eml-pop 0.5s ease;
}
@keyframes eml-pop {
  0% {
    transform: scale(0.9);
  }
  50% {
    transform: scale(1.06);
  }
  100% {
    transform: scale(1);
  }
}
/* Softer shadows for performance on mid-range phones */
.eml-panel,
.card {
  /* opt-in: games can use eml-soft-shadow class */
}
.eml-soft-shadow {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1) !important;
}
