/* Guitar Nametag Simulator */
.nametag-simulator {
  background: #f0ede8;
  font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  padding: 0 0 20px;
}
.nametag-simulator * { box-sizing: border-box; }

/* アプリ全体：左＝コントロール、右＝プレビュー。ネームタグSVGは縦横比が
   非常に縦長（約1:3.3）のため、プレビュー幅は控えめにしてノートPCの画面に
   収まるようにする */
.nametag-simulator .app {
  width: 100%; max-width: 580px; margin: 0 auto;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: center;
  gap: 32px;
  padding: 16px 20px 4px;
}

/* ━━━ 左：コントロールカラム ━━━ */
.nametag-simulator .ctrl-left {
  flex: 0 0 300px;
  max-width: 300px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

/* ━━━ 右：プレビューカラム ━━━ */
.nametag-simulator .preview-col {
  flex: 0 1 200px;
  max-width: 200px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

/* プレビュー タグ */
.nametag-simulator .dir-tag-v {
  width: 100%;
  text-align: center;
  padding: 5px 4px;
  border-radius: 6px;
  background: #333; color: #fff;
  font-size: 10px; font-weight: 500;
  line-height: 1.2;
}
.nametag-simulator .dir-tag-v small {
  display: block; font-size: 8px; color: #aaa; font-weight: 400; margin-top: 2px;
}

.nametag-simulator .strap-wrap {
  width: 100%;
}
.nametag-simulator .strap-wrap svg {
  width: 100%; height: auto; display: block;
}

/* 共通ラベル */
.nametag-simulator .box-label {
  font-size: 10px; color: #888;
  letter-spacing: .08em; font-weight: 500; text-transform: uppercase;
}

/* ━━━ 形状選択 ━━━ */
.nametag-simulator .shape-box {
  display: flex; gap: 6px;
}
.nametag-simulator .nametag-shape-btn {
  flex: 1;
  padding: 9px 6px;
  border: 1.5px solid #ddd; border-radius: 7px;
  background: #fff; cursor: pointer;
  font-size: 11px; color: #444; font-weight: 400;
  text-align: center;
}
.nametag-simulator .nametag-shape-btn.active {
  border-color: #222; background: #222; color: #fff; font-weight: 500;
}

/* ━━━ カラーパレット ━━━ */
.nametag-simulator .pal-box {
  background: #fff; border-radius: 7px; padding: 7px;
}
.nametag-simulator .palette {
  display: flex; flex-wrap: wrap; gap: 5px;
}
.nametag-simulator .nametag-swatch {
  width: 22px; height: 22px; border-radius: 50%; cursor: pointer;
  border: 1.5px solid rgba(0,0,0,.12);
  transition: transform .1s;
}
.nametag-simulator .nametag-swatch:hover { transform: scale(1.15); }
.nametag-simulator .nametag-swatch.selected {
  border: 2.5px solid #111;
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #111;
}

/* ━━━ ギター柄の刻印トグル ━━━ */
.nametag-simulator .guitar-toggle-area {
  width: 100%; margin: 0 auto;
}
.nametag-simulator .guitar-toggle {
  display: flex; align-items: center; gap: 8px;
  background: #fff; border-radius: 7px; padding: 10px 12px;
  cursor: pointer;
  font-size: 11.5px; color: #333; font-weight: 500;
}
.nametag-simulator .guitar-toggle input[type="checkbox"] {
  width: 16px; height: 16px; flex-shrink: 0; accent-color: #111; cursor: pointer;
}
.nametag-simulator .guitar-toggle .guitar-toggle-note {
  color: #888; font-weight: 400;
}

/* ━━━ 名入れ刻印 ━━━ */
.nametag-simulator .kokuin-box {
  background: #fff; border-radius: 7px; padding: 10px;
}
.nametag-simulator .kokuin-field-label {
  font-size: 10px; color: #888; font-weight: 500;
  letter-spacing: .05em; margin: 8px 0 5px;
}
.nametag-simulator .kokuin-field-label:first-child { margin-top: 0; }
.nametag-simulator .kokuin-box input[type="text"] {
  width: 100%; font-size: 13px; padding: 8px 10px;
  border: 1.5px solid #ddd; border-radius: 7px; background: #fff;
}
.nametag-simulator .kokuin-box input[type="text"]:focus {
  outline: none; border-color: #222;
}
.nametag-simulator .kokuin-box select {
  width: 100%; font-size: 12px; padding: 8px 10px;
  border: 1.5px solid #ddd; border-radius: 7px; background: #fff;
}
.nametag-simulator .kokuin-box select:focus {
  outline: none; border-color: #222;
}
.nametag-simulator .kokuin-char-count {
  font-size: 10px; color: #999; text-align: right; margin-top: 3px;
}
.nametag-simulator .kokuin-char-count.over { color: #c0392b; font-weight: 700; }
.nametag-simulator .kokuin-warn {
  font-size: 11px; color: #856404; background: #fff3cd;
  border-radius: 6px; padding: 7px 9px; margin-top: 6px; line-height: 1.6;
  display: none;
}
.nametag-simulator .kokuin-warn.show { display: block; }
.nametag-simulator .kokuin-hint {
  font-size: 10px; color: #999; line-height: 1.6; margin-top: 6px;
}
.nametag-simulator .kokuin-area-row[hidden] { display: none; }

/* ━━━ サマリー ━━━ */
.nametag-simulator .sum-box {
  background: #fff; border-radius: 7px; padding: 7px;
}
.nametag-simulator .summary-row {
  display: flex; align-items: center; gap: 5px;
  padding: 2px 0; font-size: 10.5px;
}
.nametag-simulator .summary-label {
  color: #888; font-size: 9.5px; min-width: 0; flex: 1;
}
.nametag-simulator .summary-dot {
  width: 11px; height: 11px; border-radius: 50%;
  border: 1px solid rgba(0,0,0,.12); flex-shrink: 0;
}
.nametag-simulator .summary-name {
  color: #333; font-weight: 500; font-size: 10.5px;
}

/* ━━━ 価格バー・ボタン ━━━ */
.nametag-simulator .price-bar {
  width: 100%; max-width: 580px;
  display: flex; align-items: baseline; justify-content: space-between;
  background: #fff; border-radius: 7px;
  margin: 8px auto 0; padding: 7px 10px;
}
.nametag-simulator .price-bar-label {
  font-size: 10px; color: #888;
  letter-spacing: .08em; font-weight: 500; text-transform: uppercase;
}
.nametag-simulator .price-bar-value {
  font-size: 15px; color: #222; font-weight: 700;
}
.nametag-simulator .order-note {
  font-size: 10px; color: #999; text-align: center;
  margin: 6px 10px 0; line-height: 1.5;
}
.nametag-simulator .bottom-bar {
  width: 100%; max-width: 580px;
  display: flex; align-items: center; gap: 6px; margin: 0 auto; padding: 8px 10px 0;
}
.nametag-simulator .btn-reset {
  padding: 9px 10px; border: 1px solid #ccc; border-radius: 7px;
  background: #fff; color: #666; font-size: 11px; cursor: pointer; white-space: nowrap;
}
.nametag-simulator .btn-undo {
  display: flex; align-items: center; gap: 3px;
  padding: 9px 10px; border: 1px solid #ccc; border-radius: 7px;
  background: #fff; color: #666; font-size: 11px; cursor: pointer; white-space: nowrap;
}
.nametag-simulator .btn-undo:disabled { opacity: .4; cursor: default; }
.nametag-simulator .btn-order {
  flex: 1; padding: 10px 10px; background: #c8a04a; color: #1a1a1a;
  border: none; border-radius: 7px; font-size: 11px; font-weight: 600;
  cursor: pointer; text-align: center;
}
/* ━━━ モーダル ━━━ */
.nametag-simulator .modal {
  display: none; position: fixed; top:0; left:0; width:100%; height:100%;
  background: rgba(0,0,0,.6); z-index: 9999; justify-content: center; align-items: center;
}
.nametag-simulator .modal.show { display: flex; }
.nametag-simulator .modal-content {
  background: #fff; border-radius: 12px; width: 90%; max-width: 380px;
  max-height: 90vh; overflow-y: auto; padding: 20px;
}
.nametag-simulator .modal-header {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px;
}
.nametag-simulator .modal-header h2 { font-size: 14px; font-weight: 600; margin: 0; }
.nametag-simulator .modal-close {
  background: none; border: none; font-size: 20px; cursor: pointer; color: #888;
}
.nametag-simulator .modal-image { width: 45%; display: block; margin: 0 auto 12px; border-radius: 6px; }
.nametag-simulator .modal-info  { font-size: 12px; color: #444; margin-bottom: 12px; }
.nametag-simulator .modal-color-list { margin: 6px 0; }
.nametag-simulator .modal-color-row {
  display: flex; align-items: center; gap: 7px; padding: 3px 0; font-size: 11px;
}
.nametag-simulator .modal-zone-label { color: #888; min-width: 90px; font-size: 10px; }
.nametag-simulator .modal-color-dot {
  width: 13px; height: 13px; border-radius: 50%;
  border: 1px solid rgba(0,0,0,.12); flex-shrink: 0;
}
.nametag-simulator .modal-buttons { display: flex; gap: 7px; }
.nametag-simulator .modal-btn {
  flex: 1; padding: 10px; border-radius: 7px; font-size: 12px; cursor: pointer; border: none;
}
.nametag-simulator .modal-btn-secondary { background: #f0f0f0; color: #555; }
.nametag-simulator .modal-btn-primary   { background: #111; color: #fff; font-weight: 600; }

/* ━━━ ローディング ━━━ */
.nametag-simulator .loading-overlay {
  display: none; position: fixed; top:0; left:0; width:100%; height:100%;
  background: rgba(0,0,0,.5); z-index: 9999; justify-content: center; align-items: center;
}
.nametag-simulator .loading-overlay.show { display: flex; }
.nametag-simulator .loading-content {
  background: #fff; border-radius: 12px; padding: 24px 32px; text-align: center;
}
.nametag-simulator .loading-spinner {
  width: 32px; height: 32px; border: 3px solid #eee; border-top-color: #333;
  border-radius: 50%; animation: ntspin .8s linear infinite; margin: 0 auto 10px;
}
@keyframes ntspin { to { transform: rotate(360deg); } }

/* ━━━ Toast ━━━ */
.nametag-simulator .toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #111; color: #fff; padding: 9px 18px;
  border-radius: 20px; font-size: 12px; opacity: 0;
  transition: all .3s; z-index: 10000; pointer-events: none;
}
.nametag-simulator .toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* レスポンシブ：モバイルでは縦積み */
@media (max-width: 480px) {
  .nametag-simulator .app {
    flex-direction: column-reverse;
  }
  .nametag-simulator .preview-col {
    flex: none;
    width: 100%;
    max-width: 200px;
    margin: 0 auto;
  }
}
