/* ============================================================================
   /lightbot/ — процедуры.

   Ключевая мысль страницы читается прямо в вёрстке: две программы рядом, у
   каждой видно счётчик «занято/всего» ячеек. Когда главная заполняется, а
   уровень не пройден, становится понятно, зачем нужна Proc1. Площадка —
   тёплые янтарные плитки, ничего общего с сеткой КуМира.
   ========================================================================= */

.lbd {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

/* ── Площадка ────────────────────────────────────────────────────────── */
.lbd__floor {
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--lbd-cols, 5), 1fr);
  gap: 6px;
  padding: 14px;
  border-radius: 18px;
  background: radial-gradient(120% 130% at 30% 0%, #2a1c06, #140d02);
  outline: 1px solid oklch(1 0 0 / 0.1);
  transition-property: box-shadow;
  transition-duration: .3s;
}
.lbd__floor.is-solved { box-shadow: 0 0 0 2px #fbbf24, 0 0 50px -12px #fbbf24; }
.lbd__floor.is-error  { box-shadow: 0 0 0 2px #ef4444, 0 0 50px -12px #ef4444; }

.lbd__tile {
  aspect-ratio: 1;
  border-radius: 8px;
  background: #3a2c12;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .06);
  transition-property: background-color, box-shadow;
  transition-duration: .22s;
}
/* Целевая плитка — синяя, как в самой игре; зажжённая ещё и светится. */
.lbd__tile.is-target { background: #1e3a8a; box-shadow: inset 0 -3px 0 #172554, inset 0 0 0 1px #3b82f6; }
.lbd__tile.is-lit {
  background: #fbbf24;
  box-shadow: inset 0 -3px 0 #b45309, 0 0 22px -4px #fbbf24;
}

.lbd__bot {
  position: absolute;
  left: 14px;
  top: 14px;
  width: calc((100% - 28px - (var(--lbd-cols, 5) - 1) * 6px) / var(--lbd-cols, 5));
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  font-size: clamp(16px, 3vw, 26px);
  translate: calc((100% + 6px) * var(--lbd-x, 0)) calc((100% + 6px) * var(--lbd-y, 0));
  rotate: var(--lbd-rot, 0deg);
  transition-property: translate, rotate;
  transition-duration: .3s;
  transition-timing-function: cubic-bezier(.2, 0, 0, 1);
  pointer-events: none;
}

.lbd__brief {
  margin: 14px 0 0;
  font-size: .93rem;
  line-height: 1.6;
  color: var(--lp-muted);
}

/* ── Команды ─────────────────────────────────────────────────────────── */
.lbd__palette {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}
.lbd__cmd {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 8px 12px;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, .05);
  box-shadow: inset 0 0 0 1.5px var(--lp-border);
  color: var(--lp-text);
  font: inherit;
  font-size: .88rem;
  text-align: left;
  cursor: pointer;
  transition-property: background-color, box-shadow, scale;
  transition-duration: .16s;
  transition-timing-function: cubic-bezier(.2, 0, 0, 1);
}
.lbd__cmd:hover { box-shadow: inset 0 0 0 1.5px var(--lp-primary); }
.lbd__cmd:active { scale: .96; }
.lbd__cmd-g {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 8px;
  background: var(--lp-primary);
  color: #1a1206;
  font-weight: 800;
  font-size: .9rem;
}
.lbd__cmd--proc .lbd__cmd-g { background: #a855f7; color: #fff; }
.lbd__cmd--light .lbd__cmd-g { background: transparent; }

/* ── Программы ───────────────────────────────────────────────────────── */
.lbd__strips { display: grid; gap: 12px; }

.lbd__strip {
  padding: 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .03);
  box-shadow: inset 0 0 0 1.5px var(--lp-border);
  transition-property: box-shadow, background-color;
  transition-duration: .18s;
}
.lbd__strip.is-active {
  background: rgba(251, 191, 36, .07);
  box-shadow: inset 0 0 0 2px var(--lp-primary);
}

.lbd__strip-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 32px;
  padding: 2px 4px 8px;
  border: 0;
  background: none;
  color: var(--lp-text);
  font: inherit;
  cursor: pointer;
}
.lbd__strip-name { font-weight: 700; font-size: .92rem; }
.lbd__strip-cap {
  font: 600 .8rem ui-monospace, Menlo, Consolas, monospace;
  font-variant-numeric: tabular-nums;
  color: var(--lp-muted);
}
.lbd__strip.is-active .lbd__strip-cap { color: var(--lp-primary); }

.lbd__slots {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.lbd__slot {
  width: 42px;
  height: 42px;
  border-radius: 10px;
}
.lbd__slot.is-empty {
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, .25);
  box-shadow: inset 0 0 0 1.5px var(--lp-border);
  color: rgba(255, 255, 255, .2);
  font: 600 .78rem ui-monospace, Menlo, monospace;
}
.lbd__slot-btn {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 10px;
  background: var(--lp-primary);
  color: #1a1206;
  font: 800 1rem/1 system-ui, sans-serif;
  cursor: pointer;
  transition-property: scale, box-shadow;
  transition-duration: .16s;
}
.lbd__cmd--proc.lbd__slot-btn { background: #a855f7; color: #fff; }
.lbd__cmd--light.lbd__slot-btn { background: #fde68a; }
.lbd__slot-btn:active { scale: .94; }
.lbd__slot.is-now .lbd__slot-btn { box-shadow: 0 0 0 3px #fff, 0 0 20px -2px var(--lp-glow); }

.lbd__bar { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }

@media (max-width: 860px) {
  .lbd { grid-template-columns: minmax(0, 1fr); }
}
