/* =========================================================
   Laboratorio de misiones y taller de juegos.
   ========================================================= */

/* ---------- selector de niveles ---------- */
.levelbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0 0 24px; }
.levelbar .grp { margin-left: 6px; }
.levelbar .grp:first-child { margin-left: 0; }
.lvl {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: 600 .95rem/1.2 var(--font-head);
  padding: 5px 12px 5px 5px;
  color: var(--ink);
  background: var(--paper);
  border: var(--border);
  border-radius: 999px;
  box-shadow: 0 3px 0 var(--ink);
  cursor: pointer;
}
.lvl .num { width: 1.8em; height: 1.8em; font-size: .85rem; box-shadow: none; border-width: 2.5px; }
.lvl .ico { width: 1.3em; height: 1.3em; }
.lvl:hover { background: var(--sky); }
.lvl[aria-current="true"] { background: var(--ink); color: #fff; }

/* ---------- dos columnas ---------- */
.lab { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 26px; align-items: start; }
@media (max-width: 880px) {
  .lab { grid-template-columns: 1fr; }
}

/* ---------- ficha de la misión ---------- */
.mission { margin-bottom: 22px; }
.mission .card-head { --stroke: 5px; }
.mission .card-head h2 { font-size: 1.6rem; }
.mission p { margin: 0; font-size: 1.05rem; }

details.cheat { margin-top: 22px; }
details.cheat summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font: 600 1.05rem var(--font-head);
  cursor: pointer;
  list-style: none;
  background: var(--purple-soft);
}
details.cheat summary::-webkit-details-marker { display: none; }
details.cheat summary::after { content: "▼"; margin-left: auto; font-size: .8em; transition: transform .2s; }
details.cheat:not([open]) summary::after { transform: rotate(-90deg); }
details.cheat[open] summary { border-bottom: var(--border); }
details.cheat .code { font-size: .8rem; margin: 0; border-radius: 0; border: 0; }

/* ---------- taller ---------- */
.hud { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 20px; font: 600 1rem var(--font-head); }
.hud > .ico { width: 2em; height: 2em; }
.lifebar {
  flex: 1;
  min-width: 140px;
  height: 22px;
  background: var(--paper);
  border: var(--border);
  border-radius: 999px;
  overflow: hidden;
  box-shadow: 0 3px 0 var(--ink);
}
.lifebar i {
  display: block;
  height: 100%;
  background: var(--green);
  box-shadow: inset 0 -5px 0 rgba(0, 0, 0, .15), inset 0 4px 0 rgba(255, 255, 255, .35);
  transition: width .2s;
}

.field-wrap { position: relative; }
.overlay {
  position: absolute;
  inset: 0 0 34px 1.6em;
  display: grid;
  place-items: center;
  padding: 14px;
  background: rgba(26, 26, 26, .45);
  border-radius: 16px;
  z-index: 10;
}
.overlay .card { max-width: 360px; text-align: center; }
.overlay .card-head { justify-content: center; padding: 8px 14px; }
.overlay .card-body { display: grid; justify-items: center; gap: 4px; padding: 10px 16px 16px; }
.overlay .mascot { width: 84px; }
.overlay p { margin: 0 0 6px; font-size: .95rem; line-height: 1.45; }

.dpad-wrap { display: flex; gap: 20px; align-items: end; flex-wrap: wrap; margin-top: 8px; }
.dpad {
  display: grid;
  grid-template-columns: repeat(3, 60px);
  grid-template-rows: repeat(2, 54px);
  gap: 8px;
  margin-top: 14px;
}
.dpad .btn { padding: 0; background: var(--blue); }
.dpad .btn .ico { width: 30px; height: 30px; }
.dpad [data-d="up"] .ico { transform: rotate(-90deg); }
.dpad [data-d="down"] .ico { transform: rotate(90deg); }
.dpad [data-d="left"] .ico { transform: rotate(180deg); }

.legend { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; padding: 14px; }
.legend > span {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  font-size: .88rem;
  line-height: 1.3;
  background: var(--sky);
  border: 2.5px solid var(--ink);
  border-radius: 12px;
}
.legend .ico { width: 2em; height: 2em; }
.legend code { font-size: .82em; font-weight: 600; }
