/**
 * Maze Builder - GameAnything Visual Style
 * Maze World - Create anything. Play anything.
 */

/* Match spacing with other maze games (infinite-maze, daily-maze) */
.game-page-maze-builder.anygame-content {
  padding-top: 1rem;
}

/* ========== Screens & Overlays ========== */
.mb-screen,
.mb-overlay,
.mb-modal {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 15;
  background: rgba(2, 6, 23, 0.6);
  backdrop-filter: blur(8px);
}

.mb-modal {
  z-index: 100;
  background: rgba(0, 0, 0, 0.5);
}

.mb-screen-show,
.mb-overlay-show {
  display: flex !important;
}

.mb-modal-show {
  display: flex !important;
}

.mb-modal {
  background: transparent;
  padding: 20px;
}

.mb-modal-content {
  width: min(560px, 95vw);
  max-height: 85vh;
  overflow-y: auto;
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5);
  color: #e2e8f0;
}

.mb-modal-small .mb-modal-content {
  max-width: 400px;
}

.mb-modal h3 {
  margin: 0 0 16px;
  font-size: 1.3rem;
  color: #f8fafc;
}

.mb-textarea {
  width: 100%;
  min-height: 200px;
  padding: 12px;
  border-radius: 10px;
  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: 12px;
  resize: vertical;
  margin-bottom: 12px;
}

.mb-error-msg {
  color: #f87171;
  font-size: 13px;
  margin: 8px 0 0;
}

.mb-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 16px;
}

.mb-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 16px;
}

.mb-card-small {
  max-width: 520px;
}

.mb-shortcuts {
  font-size: 12px;
  color: #94a3b8;
  margin: 12px 0 16px;
}

/* ========== Screens ========== */
.mb-screen {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 10;
  background: rgba(2, 6, 23, 0.5);
  backdrop-filter: blur(10px);
}

.mb-screen-show {
  display: flex !important;
}

.mb-overlay {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 25;
  background: rgba(2, 6, 23, 0.7);
}

.mb-overlay-show {
  display: flex !important;
}

.mb-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.mb-modal-show {
  display: flex !important;
}

.mb-modal-content {
  width: min(520px, 92vw);
  max-height: 85vh;
  overflow-y: auto;
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 20px;
  padding: 28px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5);
  color: #e2e8f0;
}

.mb-modal-small {
  width: min(380px, 92vw);
}

.mb-modal-content h3 {
  margin: 0 0 16px;
  font-size: 1.4rem;
  color: #f8fafc;
}

.mb-textarea {
  width: 100%;
  min-height: 180px;
  padding: 12px;
  border-radius: 10px;
  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: 12px;
  resize: vertical;
}

.mb-error-msg {
  color: #f87171;
  font-size: 13px;
  margin-top: 8px;
}

.mb-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 16px;
}

.mb-shortcuts {
  margin: 12px 0 0;
  font-size: 13px;
  color: #94a3b8;
}

.mb-card-small {
  max-width: 520px;
}

/* ========== Screens & Overlays ========== */
.mb-screen {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 10;
  background: rgba(2, 6, 23, 0.5);
  backdrop-filter: blur(8px);
}

.mb-screen-show {
  display: flex;
}

.mb-overlay {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 20;
  background: rgba(2, 6, 23, 0.6);
}

.mb-overlay-show {
  display: flex;
}

.mb-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
}

.mb-modal-show {
  display: flex;
}

.mb-modal-content {
  margin: 20px;
  max-height: 85vh;
  overflow-y: auto;
}

.mb-modal-small {
  max-width: 400px;
}

/* ========== App Root & Shell ========== */
.mb-app-root {
  min-height: 520px;
  margin-bottom: 24px;
}

.mb-app {
  position: relative;
  width: 100%;
  min-height: 560px;
  max-width: 980px;
  margin: 0 auto;
  border-radius: 24px;
  overflow: hidden;
  background:
    radial-gradient(circle at 16% 18%, rgba(56, 189, 248, 0.16), transparent 34%),
    radial-gradient(circle at 84% 16%, rgba(192, 132, 252, 0.16), transparent 32%),
    linear-gradient(180deg, #0b1225 0%, #172554 100%);
  border: 1px solid rgba(148, 163, 184, 0.24);
  box-shadow: 0 24px 44px rgba(2, 6, 23, 0.55);
  user-select: none;
}

.mb-app::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    160deg,
    rgba(255, 255, 255, 0.08) 0%,
    rgba(255, 255, 255, 0) 35%,
    rgba(59, 130, 246, 0.05) 100%
  );
}

/* Builder screen: align to top, allow scroll - prevents top clipping when layout > container */
#mbBuilderScreen.mb-screen-show {
  justify-content: flex-start;
  align-items: stretch;
  overflow: hidden !important;
}

/* ========== Start / Intro Screen ========== */
.mb-start-screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 20;
  background: rgba(2, 6, 23, 0.5);
  backdrop-filter: blur(10px);
}

.mb-start-screen-hidden {
  display: none !important;
}

.mb-kicker {
  display: inline-block;
  margin: 0 auto 12px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #e7efff;
  background: rgba(34, 211, 238, 0.2);
  border: 1px solid rgba(34, 211, 238, 0.4);
}

.mb-menu-panel {
  width: min(560px, 100%);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.95), rgba(2, 6, 23, 0.95));
  border: 1px solid rgba(148, 163, 184, 0.28);
  box-shadow: 0 16px 40px rgba(2, 6, 23, 0.5);
  padding: 32px;
  text-align: center;
  color: #e2e8f0;
}

.mb-menu-panel h1 {
  margin: 0 0 8px;
  font-size: clamp(32px, 5vw, 48px);
  color: #f8fafc;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-shadow: 0 4px 20px rgba(56, 189, 248, 0.35);
}

.mb-subtitle {
  margin: 0 0 24px;
  font-size: 1.1rem;
  color: #cbd5e1;
  line-height: 1.5;
}

.mb-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-bottom: 20px;
}

.mb-footer-note {
  margin-top: 16px;
  font-size: 13px;
  color: #94a3b8;
}

/* ========== Buttons ========== */
.mb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 14px;
  font-size: 14px;
  font-weight: 700;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.9);
  color: #e2e8f0;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.mb-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(2, 6, 23, 0.35);
  background: rgba(30, 41, 59, 0.95);
}

.mb-btn:active {
  transform: translateY(0) scale(0.98);
}

.mb-btn:focus-visible {
  outline: 2px solid #0ea5e9;
  outline-offset: 2px;
}

.mb-btn-primary {
  background: linear-gradient(135deg, #22d3ee, #3b82f6);
  border-color: transparent;
  color: #082f49;
}

.mb-btn-primary:hover {
  background: linear-gradient(135deg, #67e8f9, #60a5fa);
}

.mb-btn-block {
  width: 100%;
}

.mb-btn-soft {
  padding: 7px 10px;
  font-size: 12px;
  background: rgba(15, 23, 42, 0.88);
}

.mb-btn-soft:hover {
  background: rgba(30, 41, 59, 0.95);
}

.mb-btn-ghost {
  background: rgba(15, 23, 42, 0.5);
  border-color: rgba(148, 163, 184, 0.2);
  color: #94a3b8;
}

.mb-btn-ghost:hover {
  background: rgba(30, 41, 59, 0.6);
  color: #cbd5e1;
}

.mb-btn-link {
  background: transparent;
  border-color: rgba(148, 163, 184, 0.4);
}

.mb-btn-link:hover {
  background: rgba(30, 41, 59, 0.6);
}

.mb-btn-link {
  text-decoration: none;
}

.mb-btn-success {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  border-color: transparent;
  color: #fff;
}

.mb-btn-success:hover {
  background: linear-gradient(135deg, #4ade80, #22c55e);
}

.mb-btn-sm {
  padding: 8px 14px;
  font-size: 13px;
}

.mb-btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
}

/* ========== How to Build (sidebar) ========== */
.mb-how-panel {
  margin: 0;
}

.mb-how-details {
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 10px;
  overflow: hidden;
}

.mb-how-summary {
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  background: rgba(2, 6, 23, 0.4);
  list-style: none;
}

.mb-how-summary::-webkit-details-marker {
  display: none;
}

.mb-how-summary::before {
  content: '▶';
  display: inline-block;
  margin-right: 6px;
  font-size: 10px;
  transition: transform 0.2s;
}

.mb-how-details[open] .mb-how-summary::before {
  transform: rotate(90deg);
}

.mb-how-list {
  margin: 0;
  padding: 10px 12px 12px 28px;
  font-size: 12px;
  line-height: 1.6;
  color: #cbd5e1;
}

.mb-how-list li {
  margin-bottom: 6px;
}

.mb-how-panel .mb-shortcuts {
  margin: 8px 12px 10px 28px;
  font-size: 11px;
  color: #94a3b8;
}

.mb-card {
  width: min(480px, 100%);
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 20px;
  padding: 28px;
  box-shadow: 0 16px 34px rgba(2, 6, 23, 0.5);
  color: #e2e8f0;
}

.mb-card h3 {
  margin: 0 0 16px;
  font-size: 1.4rem;
  color: #f8fafc;
}

.mb-card ul {
  text-align: left;
  margin: 0 0 20px;
  padding-left: 24px;
  line-height: 1.8;
  color: #cbd5e1;
}

.mb-card li {
  margin-bottom: 8px;
}

/* ========== Builder Layout ========== */
/* Builder screen: align to top, no scrollbar (arrow keys must not trigger scroll) */
#mbBuilderScreen.mb-screen-show {
  justify-content: flex-start;
  align-items: stretch;
  overflow: hidden !important;
}

.mb-builder-layout {
  display: flex;
  flex-direction: row;
  min-height: 520px;
  min-width: 0;
  overflow: hidden;
}

@media (max-width: 900px) {
  .mb-builder-layout {
    flex-direction: column;
    min-height: auto;
  }
}

/* Toolbar - left side */
.mb-toolbar {
  width: 68px;
  flex-shrink: 0;
  padding: 14px 10px;
  background: rgba(2, 6, 23, 0.5);
  border-right: 1px solid rgba(148, 163, 184, 0.22);
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}

@media (max-width: 900px) {
  .mb-toolbar {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    padding: 12px;
    border-right: none;
    border-bottom: 1px solid rgba(148, 163, 184, 0.22);
    gap: 8px;
  }
}

.mb-tool-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}

@media (max-width: 900px) {
  .mb-tool-group {
    flex-direction: row;
  }
}

.mb-tool-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #94a3b8;
  text-transform: uppercase;
  margin-bottom: 2px;
}

@media (max-width: 900px) {
  .mb-tool-label {
    width: 100%;
    text-align: center;
    margin-bottom: 0;
    margin-right: 8px;
  }
}

.mb-tool-btn {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.28);
  color: #e2e8f0;
  cursor: pointer;
  font-size: 18px;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.mb-tool-btn:hover {
  background: rgba(30, 41, 59, 0.9);
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(2, 6, 23, 0.35);
}

.mb-tool-btn:active {
  transform: translateY(0) scale(0.98);
}

.mb-tool-btn.active {
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.35), rgba(59, 130, 246, 0.35));
  border-color: rgba(34, 211, 238, 0.6);
  box-shadow: 0 0 14px rgba(34, 211, 238, 0.35);
}

.mb-tool-btn:focus-visible {
  outline: 2px solid #0ea5e9;
  outline-offset: 2px;
}

.mb-tool-btn:focus-visible {
  outline: 2px solid #0ea5e9;
  outline-offset: 2px;
}

/* Canvas area - no scrollbar (arrow keys must not trigger scroll) */
.mb-canvas-area {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow: hidden !important;
  background: rgba(2, 6, 23, 0.35);
  min-height: 380px;
}

.mb-canvas-container {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden !important;
  max-width: 100%;
  max-height: 100%;
}

.mb-canvas {
  display: block;
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  cursor: crosshair;
  border: 1px solid rgba(148, 163, 184, 0.15);
}

/* Sidebar - right panel */
.mb-sidebar {
  width: 260px;
  flex-shrink: 0;
  padding: 16px 14px;
  background: rgba(2, 6, 23, 0.45);
  border-left: 1px solid rgba(148, 163, 184, 0.22);
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
}

@media (max-width: 900px) {
  .mb-sidebar {
    width: 100%;
    border-left: none;
    border-top: 1px solid rgba(148, 163, 184, 0.22);
    flex-direction: row;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
  }
}

.mb-panel {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mb-panel label {
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.mb-validation-panel {
  gap: 4px;
}

.mb-validation-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  width: fit-content;
}

.mb-validation-status.valid {
  background: rgba(34, 197, 94, 0.2);
  border: 1px solid rgba(34, 197, 94, 0.45);
  color: #86efac;
}

.mb-validation-status.invalid {
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: #fcd34d;
}

.mb-validation-status.warning {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

.mb-validation-msg {
  font-size: 12px;
  color: #94a3b8;
  margin: 0;
  line-height: 1.5;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.4);
}

/* Override .anygame-content p:first-of-type (18px) - keep validation msg small */
#mbAppRoot p.mb-validation-msg,
.anygame-content.game-page-maze-builder p.mb-validation-msg {
  font-size: 12px !important;
}

.mb-validation-msg.mb-validation-msg-warning {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.mb-actions-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.mb-actions-panel .mb-btn-primary {
  grid-column: 1 / -1;
}

.mb-coming-soon {
  opacity: 0.85;
}

.mb-input {
  width: 100%;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(15, 23, 42, 0.8);
  color: #e2e8f0;
  font-size: 13px;
  font-weight: 500;
}

.mb-input:focus {
  outline: none;
  border-color: rgba(56, 189, 248, 0.6);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.mb-select {
  width: 100%;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(15, 23, 42, 0.8);
  color: #e2e8f0;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.mb-select:focus {
  outline: none;
  border-color: rgba(56, 189, 248, 0.6);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

@media (max-width: 600px) {
  .mb-actions-panel {
    grid-template-columns: 1fr;
  }
  .mb-actions-panel .mb-btn-primary {
    grid-column: 1;
  }
}

/* ========== Playtest Mode ========== */
.mb-playtest-wrap {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 400px;
}

.mb-playtest-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 16px;
  background: rgba(2, 6, 23, 0.72);
  border-bottom: 1px solid rgba(148, 163, 184, 0.24);
  font-size: 13px;
  color: #cbd5e1;
}

.mb-playtest-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  min-height: 0;
}

.mb-playtest-overlay {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  z-index: 15;
  background: rgba(2, 6, 23, 0.9);
}

.mb-playtest-overlay-show {
  display: flex;
}

.mb-playtest-hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  background: rgba(15, 23, 42, 0.9);
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.mb-playtest-canvas-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

/* Playtest screen layout */
.mb-playtest-wrap {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 400px;
}

.mb-playtest-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: rgba(2, 6, 23, 0.72);
  border-bottom: 1px solid rgba(148, 163, 184, 0.24);
  font-size: 13px;
  color: #cbd5e1;
}

.mb-playtest-header > div {
  display: flex;
  gap: 8px;
}

/* No scrollbar - arrow keys must move player, not scroll */
.mb-playtest-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow: hidden;
}

.mb-player {
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f97316, #fb923c);
  border: 2px solid #fdba74;
  box-shadow: 0 0 12px rgba(249, 115, 22, 0.6);
  transition: left 0.08s ease-out, top 0.08s ease-out;
  pointer-events: none;
}

.mb-win-overlay {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(2, 6, 23, 0.7);
  z-index: 16;
}

.mb-win-overlay-show {
  display: flex;
}

.mb-win-card {
  padding: 32px;
  text-align: center;
  background: rgba(15, 23, 42, 0.95);
  border-radius: 20px;
  border: 1px solid rgba(34, 197, 94, 0.4);
  box-shadow: 0 0 40px rgba(34, 197, 94, 0.2);
}

.mb-win-card h3 {
  margin: 0 0 12px;
  font-size: 1.8rem;
  color: #4ade80;
}

.mb-win-card p {
  margin: 0 0 20px;
  color: #cbd5e1;
}

/* ========== Modals ========== */
.mb-modal-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.mb-modal-overlay-show {
  display: flex;
}

.mb-modal {
  width: min(480px, 92vw);
  max-height: 80vh;
  overflow-y: auto;
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 20px;
  padding: 28px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5);
  color: #e2e8f0;
}

.mb-modal h3 {
  margin: 0 0 16px;
  font-size: 1.4rem;
  color: #f8fafc;
}

.mb-modal textarea {
  width: 100%;
  min-height: 120px;
  padding: 12px;
  border-radius: 10px;
  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: 12px;
  resize: vertical;
}

.mb-modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 20px;
}

/* ========== Toast ========== */
.mb-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(20px);
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  z-index: 200;
  transition: opacity 0.25s ease, transform 0.25s ease;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(34, 211, 238, 0.4);
  color: #e2e8f0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.mb-toast-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ========== Example Picker ========== */
.mb-example-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 16px 0;
  max-height: 280px;
  overflow-y: auto;
}

.mb-example-btn {
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(15, 23, 42, 0.8);
  color: #e2e8f0;
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.mb-example-btn:hover {
  background: rgba(30, 41, 59, 0.95);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(2, 6, 23, 0.35);
}

/* ========== Coming Soon Popup ========== */
.mb-coming-soon-content {
  text-align: center;
  padding: 20px 0;
}

.mb-coming-soon-content p {
  margin: 0 0 16px;
  color: #cbd5e1;
  line-height: 1.6;
}

/* ========== Example Picker ========== */
.mb-example-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 16px 0;
  max-height: 280px;
  overflow-y: auto;
}

.mb-example-btn {
  display: block;
  width: 100%;
  padding: 12px 16px;
  text-align: left;
  font-size: 14px;
  font-weight: 600;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(30, 41, 59, 0.7);
  color: #e2e8f0;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.mb-example-btn:hover {
  background: rgba(51, 65, 85, 0.9);
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(2, 6, 23, 0.35);
}

/* ========== Animations ========== */
@keyframes mb-pop {
  0% { transform: scale(0.9); opacity: 0.5; }
  70% { transform: scale(1.05); }
  100% { transform: scale(1); opacity: 1; }
}

.mb-tile-place {
  animation: mb-pop 0.15s ease-out;
}

@keyframes mb-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.mb-exit-glow {
  animation: mb-pulse 1.5s ease-in-out infinite;
}

/* How to Build - sidebar collapsible */
.mb-sidebar .mb-how-panel {
  position: static;
  display: block;
  padding: 0;
  background: none;
  backdrop-filter: none;
}
.mb-how-details {
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 10px;
  overflow: hidden;
}
.mb-how-summary {
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  list-style: none;
  background: rgba(15, 23, 42, 0.5);
}
.mb-how-summary::-webkit-details-marker { display: none; }
.mb-how-list {
  margin: 0;
  padding: 10px 12px 10px 24px;
  font-size: 12px;
  line-height: 1.6;
  color: #cbd5e1;
}
.mb-how-list li { margin-bottom: 6px; }
.mb-how-panel .mb-shortcuts {
  margin: 8px 12px 0;
  font-size: 11px;
}

/* How to Build - sidebar collapsible panel */
.mb-sidebar .mb-how-panel {
  position: static;
  display: block;
  padding: 0;
  background: transparent;
  backdrop-filter: none;
}
.mb-how-details {
  margin: 0;
  padding: 0;
  border: none;
}
.mb-how-summary {
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  padding: 4px 0;
  list-style: none;
}
.mb-how-summary::-webkit-details-marker { display: none; }
.mb-how-summary::marker { display: none; }
.mb-how-list {
  margin: 8px 0 0;
  padding-left: 18px;
  font-size: 12px;
  line-height: 1.6;
  color: #cbd5e1;
}
.mb-how-list li { margin-bottom: 6px; }
.mb-how-panel .mb-shortcuts {
  margin: 8px 0 0;
  font-size: 11px;
  color: #64748b;
}

/* How to Build - sidebar collapsible panel */
.mb-sidebar .mb-how-panel {
  position: static;
  display: block;
  padding: 0;
  background: transparent;
  backdrop-filter: none;
}
.mb-how-details {
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 10px;
  background: rgba(2, 6, 23, 0.4);
}
.mb-how-summary {
  padding: 10px 12px;
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  list-style: none;
}
.mb-how-summary::-webkit-details-marker { display: none; }
.mb-how-list {
  margin: 0 0 8px;
  padding: 0 12px 12px 20px;
  font-size: 12px;
  line-height: 1.6;
  color: #cbd5e1;
}
.mb-how-list li { margin-bottom: 4px; }
.mb-how-panel .mb-shortcuts {
  margin: 0 12px 12px;
  font-size: 11px;
  color: #64748b;
}

/* How to Build - sidebar collapsible panel */
.mb-sidebar .mb-how-panel {
  position: static;
  display: block;
  padding: 0;
  background: none;
  backdrop-filter: none;
}
.mb-how-details {
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  overflow: hidden;
}
.mb-how-summary {
  padding: 8px 10px;
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  list-style: none;
  background: rgba(2, 6, 23, 0.4);
}
.mb-how-summary::-webkit-details-marker { display: none; }
.mb-how-summary::marker { display: none; }
.mb-how-list {
  margin: 0;
  padding: 10px 12px 8px 20px;
  font-size: 12px;
  line-height: 1.6;
  color: #cbd5e1;
}
.mb-how-list li { margin-bottom: 6px; }
.mb-how-panel .mb-shortcuts {
  margin: 8px 12px 0;
  font-size: 11px;
}
