/* ==========================================
   立方体・直方体メーカー CSS
   Plugin:  cuboid-maker
   Prefix:  cbm-
   Version: 3.0.0（ピンチズーム対応・回転ボタン削除・1ブロック固定サイズ）
   ========================================== */

.cbm-root, .cbm-root * { box-sizing: border-box; }

.cbm-root {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: "BIZ UDGothic", "M PLUS Rounded 1c", "Hiragino Sans", "Yu Gothic UI", sans-serif;
  background: #f5f7fa;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  z-index: 9999;
}

/* ===== ヘッダー ===== */
.cbm-root .cbm-header {
  position: fixed; top: 0; left: 0; right: 0;
  height: 52px;
  background: #1e3a5f;
  color: #fff;
  display: flex; align-items: center;
  padding: 0 16px;
  gap: 12px;
  z-index: 10;
}
.cbm-root .cbm-header h1 { font-size: 18px; font-weight: bold; flex: 1; margin: 0; }
.cbm-root .cbm-info { font-size: 14px; opacity: 0.85; }

/* ===== フルスクリーンcanvas ===== */
.cbm-root #cbm-canvas {
  position: fixed;
  top: 52px; left: 0;
  width: 100vw;
  height: calc(100vh - 52px);
  background: #f0f4f9;
  display: block;
}

/* ===== 右下ツールバー ===== */
/* 修正: 回転ボタンを削除したので3個構成（⚙🗑＋） */
.cbm-root .cbm-toolbar {
  position: fixed;
  right: 16px; bottom: 20px;
  display: flex; flex-direction: column;
  gap: 12px;
  z-index: 10;
}
.cbm-root .cbm-btn {
  width: 60px; height: 60px;
  border-radius: 999px;
  border: none;
  font-size: 26px;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(0,0,0,0.25);
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}
.cbm-root .cbm-btn:active { transform: scale(0.92); }
.cbm-root .cbm-btn-add     { background: #d4af37; color: #fff; font-size: 34px; }
.cbm-root .cbm-btn-delete  { background: #fff; color: #c0392b; border: 2px solid #c0392b; }
.cbm-root .cbm-btn-setting { background: #fff; color: #1e3a5f; border: 2px solid #1e3a5f; }
.cbm-root .cbm-btn:disabled { opacity: 0.35; cursor: default; }
.cbm-root .cbm-btn:disabled:active { transform: none; }

/* 修正: 現在のズーム倍率を表示する小さなバッジ */
.cbm-root .cbm-zoom-badge {
  position: fixed;
  left: 16px; bottom: 20px;
  background: rgba(30,58,95,0.85);
  color: #fff;
  font-size: 12px;
  font-weight: bold;
  padding: 6px 12px;
  border-radius: 999px;
  z-index: 10;
  pointer-events: none;
}

/* ===== ステップ画面（オーバーレイ） ===== */
.cbm-root .cbm-overlay {
  position: fixed; inset: 0;
  background: rgba(30,58,95,0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
  padding: 12px;
  touch-action: none;
}
.cbm-root .cbm-overlay.hidden { display: none; }
.cbm-root .cbm-dialog {
  position: relative;
  background: #fff;
  border-radius: 16px;
  padding: 26px 26px 22px;
  width: min(92vw, 420px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.3);
  text-align: center;
}
.cbm-root .cbm-dialog h2 { color: #1e3a5f; font-size: 19px; margin: 0 0 6px; }
.cbm-root .cbm-step-label {
  display: inline-block;
  background: #d4af37;
  color: #fff;
  font-size: 12px;
  font-weight: bold;
  border-radius: 999px;
  padding: 3px 14px;
  margin-bottom: 10px;
}
.cbm-root .cbm-hint { font-size: 13px; color: #5a708a; margin: 0 0 18px; }

.cbm-root .cbm-close {
  position: absolute;
  top: 12px; right: 12px;
  width: 32px; height: 32px;
  border-radius: 999px;
  border: none;
  background: #eef2f6;
  color: #5a708a;
  font-size: 16px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.cbm-root .cbm-form { display: flex; flex-direction: column; gap: 14px; margin-bottom: 20px; }
.cbm-root .cbm-input-group { text-align: left; }
.cbm-root .cbm-input-group label {
  display: block;
  font-size: 13px;
  font-weight: bold;
  color: #1e3a5f;
  margin-bottom: 4px;
}
.cbm-root .cbm-input-group input[type="number"] {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 2px solid #c8d4e8;
  font-size: 16px;
  color: #1e3a5f;
}
.cbm-root .cbm-input-group input[type="number"]:focus { outline: none; border-color: #d4af37; }
.cbm-root .cbm-input-error { border-color: #c0392b !important; }
.cbm-root .cbm-error-msg {
  display: none;
  font-size: 11px;
  color: #c0392b;
  margin-top: 4px;
}
.cbm-root .cbm-error-msg.cbm-show { display: block; }

.cbm-root .cbm-decide-btn {
  width: 100%;
  padding: 14px 0;
  border-radius: 999px;
  border: none;
  background: #d4af37;
  color: #fff;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.cbm-root .cbm-decide-btn:active { transform: scale(0.97); }

.cbm-root .hidden { display: none !important; }
