/* ===========================================================================
   Bebela Code — palco de missão
   Complementa css/play.css sem substituir seus hooks mz-*.
   ======================================================================== */

.mz-root {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  min-width: 0;
  padding: clamp(8px, 2vw, 18px);
  overflow: hidden;
  border: 1px solid rgba(28, 47, 76, .18);
  border-bottom-width: 4px;
  border-radius: 18px;
  background: var(--mz-bg, #eef7ff);
  color: var(--ink, #253653);
}

.mz-world-backdrop {
  position: absolute;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  background-position: center;
  background-size: cover;
  opacity: 0;
  transition: opacity .24s ease;
}

.mz-world-backdrop--active { opacity: .18; }

.mz-root > :not(.mz-world-backdrop) {
  position: relative;
  z-index: 1;
}

.mz-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid rgba(28, 47, 76, .14);
  border-radius: 12px;
  background: rgba(255, 255, 255, .88);
  box-sizing: border-box;
}

.mz-hud-top {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
  gap: 8px;
}

.mz-world-name {
  max-width: 44%;
  overflow: hidden;
  color: var(--muted, #65718a);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  line-height: 1.2;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.mz-status {
  min-width: 0;
  overflow: hidden;
  color: #314665;
  font-size: clamp(14px, 2vw, 17px);
  font-weight: 850;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mz-status--running { color: #236f91; }
.mz-status--win { color: #2f7d4f; }
.mz-status--fail { color: #b54958; }

.mz-progress {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 5px;
  min-height: 28px;
  padding: 4px 8px;
  border: 1px solid rgba(184, 116, 8, .24);
  border-radius: 999px;
  background: #fff8e6;
  color: #805a19;
  font-size: 13px;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
}

.mz-progress-icon {
  color: var(--gold-dark, #b87408);
  font-size: 16px;
  line-height: 1;
}
.mz-progress[hidden] { display: none; }
.mz-hud, .mz-feedback { font-family: "Avenir Next", system-ui, sans-serif; }

.mz-grid {
  flex: 0 1 auto;
  width: 100%;
  max-width: min(100%, 900px, calc(62vh * var(--mz-cols, 7) / var(--mz-rows, 6)));
  margin: 0 auto;
  overflow: visible;
}

.mz-cells {
  border-color: rgba(24, 42, 69, .26);
  border-radius: 14px;
  box-shadow: 0 3px 0 rgba(24, 42, 69, .14);
}

.mz-floor {
  background: var(--mz-floor, #e6f2ff);
}

.mz-floor.mz-alt { background: var(--mz-floor-alt, #d8eaff); }

.mz-wall {
  border: 1px solid rgba(18, 35, 59, .28);
  background: var(--mz-wall, #3b5b7d);
  box-sizing: border-box;
}

/* Um ponto baixo e translúcido mantém o caminho legível sem competir com o
   herói, coletáveis ou bandeira. */
.mz-cell.mz-floor.mz-visited::after {
  position: absolute;
  right: 12%;
  bottom: 12%;
  width: 14%;
  height: 14%;
  border-radius: 50%;
  background: var(--mz-accent, #58cc02);
  content: "";
  opacity: .46;
}

.mz-goal-cell::before { opacity: .3; }
.mz-goal { animation-iteration-count: 3; }
.mz-goal-cell::before { animation-iteration-count: 3; }
.mz-item { animation-iteration-count: 3; }

.mz-feedback {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 2px 8px;
  color: var(--muted, #65718a);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.25;
  text-align: center;
  transition: color .16s ease;
}

.mz-feedback--running { color: #236f91; }
.mz-feedback--move,
.mz-feedback--turn { color: #536b8b; }
.mz-feedback--pick,
.mz-feedback--win { color: #2f7d4f; }
.mz-feedback--bad { color: #b54958; }
.mz-feedback--say { color: #7254a3; }

@media (max-width: 420px) {
  .mz-root { gap: 7px; padding: 7px; border-radius: 14px; }
  .mz-hud { min-height: 38px; padding: 6px 7px; border-radius: 10px; }
  .mz-hud-top { gap: 5px; }
  .mz-world-name { max-width: 37%; font-size: 9px; }
  .mz-status { font-size: 13px; }
  .mz-progress { min-height: 25px; padding: 3px 6px; font-size: 12px; }
  .mz-progress-icon { font-size: 14px; }
  .mz-feedback { min-height: 24px; font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .mz-world-backdrop,
  .mz-feedback { transition: none; }

  .mz-goal,
  .mz-goal-cell::before,
  .mz-item { animation: none !important; }
}
