/* Bridge Level Builder - Create My Levels for Bridge the Snake */
.blb-app {
  display: grid;
  grid-template-columns: 72px 1fr 220px;
  gap: 14px;
  padding: 14px;
  min-height: 500px;
  align-items: stretch;
}
.blb-toolbar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-self: stretch;
  padding: 10px 8px;
  border-radius: 12px;
  background: rgba(15,23,42,0.48);
  border: 1px solid rgba(148,163,184,0.22);
}
.blb-tool-btn {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid rgba(148,163,184,0.3);
  background: rgba(30,41,59,0.8);
  color: #e2e8f0;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.blb-tool-btn:hover {
  background: rgba(51,65,85,0.9);
  border-color: rgba(148,163,184,0.5);
}
.blb-tool-btn.active {
  background: rgba(34,197,94,0.3);
  border-color: rgba(34,197,94,0.6);
}
.blb-canvas-wrap {
  align-self: stretch;
  min-height: 0;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(15,23,42,0.42);
  border: 1px solid rgba(148,163,184,0.2);
  padding: 12px;
}
.blb-grid {
  display: inline-grid;
  gap: 0;
  background: #0f172a;
  border: 1px solid rgba(148,163,184,0.26);
  border-radius: 8px;
  padding: 8px;
  box-shadow: inset 0 0 0 1px rgba(148,163,184,0.1);
}
.blb-cell {
  width: 24px;
  height: 24px;
  font-size: 13px;
  line-height: 24px;
  text-align: center;
  cursor: pointer;
  border: 1px solid rgba(148,163,184,0.1);
  font-family: ui-monospace, monospace;
}
.blb-cell:hover {
  background: rgba(148,163,184,0.15);
}
.blb-cell[data-tile=" "] { color: #334155; }
.blb-cell[data-tile="#"] { color: #94a3b8; background: rgba(71,85,105,0.4); }
.blb-cell[data-tile="+"] { color: #fbbf24; background: rgba(251,191,36,0.2); }
.blb-cell[data-tile="@"] { color: #f97316; background: rgba(249,115,22,0.2); }
.blb-cell[data-tile="="] { color: #22c55e; background: rgba(34,197,94,0.2); }
.blb-cell[data-tile="_"] { color: #64748b; background: rgba(100,116,139,0.2); }
.blb-sidebar {
  width: 200px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-self: stretch;
  padding: 10px;
  border-radius: 12px;
  background: rgba(15,23,42,0.48);
  border: 1px solid rgba(148,163,184,0.22);
}
.blb-btn {
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid rgba(148,163,184,0.3);
  background: rgba(30,41,59,0.8);
  color: #e2e8f0;
  cursor: pointer;
  font-size: 14px;
}
.blb-btn:hover {
  background: rgba(51,65,85,0.9);
}
.blb-btn-primary {
  background: rgba(34,197,94,0.3);
  border-color: rgba(34,197,94,0.5);
}
.blb-btn-primary:hover {
  background: rgba(34,197,94,0.4);
}

@media (max-width: 980px) {
  .blb-app {
    grid-template-columns: 60px 1fr;
    grid-template-areas:
      "tools canvas"
      "side side";
    min-height: 520px;
  }
  .blb-toolbar { grid-area: tools; }
  .blb-canvas-wrap { grid-area: canvas; }
  .blb-sidebar {
    grid-area: side;
    width: auto;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }
  .blb-cell {
    width: 18px;
    height: 18px;
    line-height: 18px;
    font-size: 12px;
  }
}
.blb-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  background: rgba(0,0,0,0.6);
  padding: 20px;
}
.blb-modal.show { display: flex; }
.blb-modal-content {
  background: rgba(15,23,42,0.98);
  border: 1px solid rgba(148,163,184,0.3);
  border-radius: 16px;
  padding: 24px;
  max-width: 540px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
}
.blb-modal h3 { margin: 0 0 16px; font-size: 1.2rem; }
.blb-textarea {
  width: 100%;
  min-height: 200px;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid rgba(148,163,184,0.3);
  background: rgba(2,6,23,0.6);
  color: #e2e8f0;
  font-family: ui-monospace, monospace;
  font-size: 11px;
  resize: vertical;
  margin-bottom: 12px;
}
.blb-modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 12px; }
