/* ベース */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: "Zen Maru Gothic", "Quicksand", system-ui, -apple-system,
    BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif;
  background: #f6f4f0;
  color: #333;
}

.page {
  min-height: 100vh;
  max-width: 480px;
  margin: 0 auto;
  background: #fdfbf8;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
}

/* ヘッダー */

.page-header {
  padding: 16px 20px 8px;
  border-bottom: 1px solid #e3dfd6;
}

.logo-text {
  margin: 0;
  font-size: 20px;
  letter-spacing: 0.08em;
  font-weight: 700;
}

/* モードタブ */

.mode-tabs {
  display: flex;
  padding: 8px 10px 0;
  gap: 8px;
}

.mode-tab {
  flex: 1;
  border: none;
  border-radius: 999px;
  padding: 8px 10px;
  font-size: 13px;
  background: #e7e2d7;
  color: #666;
  cursor: pointer;
}

.mode-tab.active {
  background: #4da08c;
  color: #fff;
}

/* メイン */

.main {
  padding: 12px 16px 20px;
}

.main-custom {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

@media (min-width: 720px) {
  .main-custom {
    display: grid;
    grid-template-columns: 1.1fr 1.1fr;
    gap: 16px;
  }

  /* PCのときもプレビューを左側に */
  .preview-section {
    order: 1;
  }
  .form-section {
    order: 2;
  }
}

.main-snapshot {
  display: block;
}

.hidden {
  display: none !important;
}

/* セクション共通 */

.section-title {
  font-size: 16px;
  margin: 10px 0 4px;
}

.form-section,
.preview-section {
  background: #fffdf8;
  border-radius: 18px;
  padding: 12px 14px 14px;
  border: 1px solid #e8e1d4;
}

/* セレクトなど */

.select-row {
  margin: 4px 0 10px;
}

select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid #d8d1c5;
  font-size: 15px;
  background: #faf7f2;
}

.category-row {
  display: flex;
  gap: 6px;
  margin-top: 4px;
  margin-bottom: 4px;
}

.category-btn {
  flex: 1;
  padding: 6px 4px;
  border-radius: 999px;
  border: 1px solid #cfc6b8;
  background: #f5f0e6;
  font-size: 12px;
  cursor: pointer;
}

.category-btn.active {
  background: #4da08c;
  border-color: #4da08c;
  color: #fff;
}

/* コントロール */

.control-group {
  margin: 8px 0;
}

.control-label {
  font-size: 12px;
  color: #777;
  display: block;
  margin-bottom: 4px;
}

input[type="range"] {
  width: 100%;
}

.flip-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pill-btn {
  border-radius: 999px;
  border: 1px solid #cfc6b8;
  padding: 6px 12px;
  font-size: 12px;
  background: #f5f0e6;
  cursor: pointer;
}

/* プレビュー枠 */

.preview-frame {
  padding: 10px;
  border-radius: 16px;
  background: linear-gradient(180deg, #fbf7f2 0%, #f0ebe4 100%);
  border: 1px solid #e5ddcf;
}

/* バッグプレビュー：バッグを大きめに見せる */

.bag-preview {
  position: relative;
  width: 100%;
  max-width: 320px;   /* ここでバッグの最大幅を調整 */
  margin: 0 auto;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.bag-image {
  width: 92%;
  height: auto;
  display: block;
}

.applique-image {
  position: absolute;
  width: 60%;
  max-width: 70%;
  touch-action: none;
  cursor: grab;
  transform: translate(-50%, -50%);
  left: 60%;
  top: 55%;
}

/* 情報パネル */

.info-panel {
  margin-top: 8px;
  font-size: 13px;
}

.info-panel p {
  margin: 2px 0;
}

/* 名前横のアイコン */

.label-icon {
  width: 26px;
  height: 26px;
  object-fit: contain;
  vertical-align: middle;
  margin: 0 4px 0 4px;
  border-radius: 6px;
  background: #f3eee5;
}

/* メモ・ヒント */

.note {
  margin-top: 8px;
  font-size: 11px;
  color: #888;
}

.hint {
  margin-top: 6px;
  font-size: 11px;
  color: #888;
}

/* ボタン */

.primary-btn {
  margin-top: 10px;
  width: 100%;
  border-radius: 999px;
  border: none;
  padding: 10px;
  font-size: 14px;
  background: #e0595d;
  color: #fff;
  cursor: pointer;
}

/* スクショモード */

.snapshot-header {
  text-align: center;
  margin-bottom: 4px;
}

.back-btn {
  border: none;
  background: none;
  font-size: 13px;
  color: #555;
  cursor: pointer;
  margin-bottom: 4px;
}

.snapshot-title {
  margin: 4px 0 0;
  font-size: 18px;
}

.snapshot-sub {
  margin: 4px 0 8px;
  font-size: 13px;
  color: #777;
}

.snapshot-preview {
  background: #fffdf8;
  border-radius: 18px;
  padding: 12px 14px 20px;
  border: 1px solid #e8e1d4;
}

.snapshot-frame {
  padding: 10px;
  border-radius: 16px;
  background: #f6f1e9;
  border: 1px solid #e0d7c8;
}

.snapshot-bag {
  max-width: 380px;
}

.snapshot-info {
  margin-top: 10px;
  font-size: 13px;
}

.snapshot-note {
  font-size: 11px;
  color: #888;
}

/* 使い方 */

.snapshot-howto {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px dotted #d9d0c4;
}

.snapshot-howto-title {
  margin: 0 0 4px;
  font-size: 14px;
}

.snapshot-howto-text {
  margin: 0;
  font-size: 12px;
  color: #666;
}

/* LINEボタン */

.line-button {
  display: block;
  margin-top: 16px;
  text-align: center;
  text-decoration: none;
  border-radius: 999px;
  padding: 12px 10px;
  font-size: 15px;
  background: #00b900;
  color: #fff;
  font-weight: 700;
}

/* スマホ微調整 */

@media (max-width: 480px) {
  .page-header {
    padding-top: 12px;
  }

  .bag-preview {
    max-width: 100%;
  }
}
/* 背景（黒くモヤッとさせる部分） */
.howto-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: none;            /* ← 最初は隠す */
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

/* 表示時につけるクラス */
.howto-modal.show {
  display: flex;
}

/* 中身（画像が入るボックス） */
.howto-modal-content {
  background: #fffaf0;
  max-width: 420px;
  width: 90%;
  max-height: 90vh;         /* ← 長い画像対応 */
  overflow-y: auto;
  border-radius: 16px;
  padding: 12px 12px 16px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  position: relative;
}

/* 画像サイズ調整 */
.howto-image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
}

/* 閉じるボタン（×） */
.howto-close {
  position: absolute;
  top: 8px;
  right: 10px;
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
}
