/* ==========================================
   MojiM2 style.css
   ------------------------------------------
   1. 基本設定・背景
   2. ヘッダー
   3. メインコンテナ
   4. ドロップゾーン・ヘルプ
   5. フォーム
   6. ボタン・ステータス・ローディング
   7. 結果エリア・文字編集UI
   8. モーダル共通
   9. 位置修正・スタンプ修正モーダル
  10. スタンプ追加モーダル
  11. 確認モーダル類
  12. スタンプセットUI
   ========================================== */

/* ==========================================
   1. 基本設定・背景
   ========================================== */
html, body {
  margin: 0;
  padding: 0;
  font-family: 'Zen Maru Gothic',sans-serif;
  font-weight: 900; /* ★全体的に文字を少しだけ太めにしてぷっくりさせる */
  
  background-image: url('../images/site_background.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  background-color: #f5f7fa;
}

/* すべての要素のサイズ計算を狂わせないための魔法の3行 */
*, *::before, *::after {
  box-sizing: border-box;
}

/* ==========================================
   2. ヘッダー
   ========================================== */
.site-header {
  background-image: url('../images/header_background.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  padding: 5px 15px;
  margin: 0;
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-logo {
  height: 55px;
  width: auto;
  object-fit: contain;
  transition: opacity 0.2s ease;
  border: none !important;
  border-radius: 0 !important;
}

/* ロゴを囲むリンク自体の設定 */
.header-logo-link {
  display: inline-block;
  text-decoration: none; /* 下線などを消す */
  cursor: pointer;       /* マウスカーソルを指マークにする */
}

.header-logo:hover {
  opacity: 0.8; /* マウスを乗せたときに少しフワッと明るく（半透明に）なる */
}

.header-links {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.header-teaser-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  color: rgba(255, 150, 200, 0.85);
  text-decoration: none;
  font-size: 13px;
  font-weight: bold;
  border: 1px solid rgba(255, 0, 170, 0.4);
  border-radius: 999px;
  background: rgba(10, 5, 20, 0.45);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.header-teaser-link:hover {
  color: #ffffff;
  border-color: #ff00aa;
  box-shadow: 0 0 12px rgba(255, 0, 170, 0.45);
}

.header-teaser-icon {
  font-size: 13px;
  line-height: 1;
}

.header-teaser-text {
  line-height: 1;
}

.header-x-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  color: rgba(184, 199, 224, 0.75);
  text-decoration: none;
  font-size: 13px;
  font-weight: bold;
  border: 1px solid rgba(0, 240, 255, 0.35);
  border-radius: 999px;
  background: rgba(10, 5, 20, 0.45);
  transition: all 0.2s ease;
}

.header-x-link:hover {
  color: #ffffff;
  border-color: #00f0ff;
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.45);
}

.header-x-icon {
  font-size: 15px;
  line-height: 1;
}

/* ==========================================
   3. メインコンテナ
   ========================================== */
.container {
  width: calc(100% - 30px); /* 左右に15pxずつの隙間を作る */
  max-width: 600px;         /* PCなどの大画面では最大600pxでストップ */
  margin: 20px auto;
  padding: 20px;
  
  background-color: rgba(12, 6, 24, 0.65); /* 半透明ネオンガラス背景 */
  backdrop-filter: blur(14px);               /* 背景をぼかすガラス効果 */
  -webkit-backdrop-filter: blur(14px);
  border: 1.5px solid rgba(0, 240, 255, 0.6); /* 外周の基本ネオンライン */
  border-radius: 16px;
  /* ブルー（外側上部）とピンク（外側下部）の多重ネオン発光 */
  box-shadow: 
    0 0 15px rgba(0, 240, 255, 0.4),
    0 0 30px rgba(255, 0, 170, 0.3),
    inset 0 0 20px rgba(0, 240, 255, 0.15);
  color: #f3e8ff; /* コンテナ内の基本文字色 */
}

.warning-notice {
      font-size: 11px;
      color: #c48b9f;
      margin-bottom: 6px;
      line-height: 1.3;
      opacity: 0.85;
    }
    
/* ==========================================
   4. 大画面（PC）ヘッダー・コンテナ調整
   ========================================== */
@media (min-width: 600px) {
  .site-header {
    padding: 8px 20px;
  }
  
  .header-logo {
    height: 75px;
  }
  
  .container {
    margin: 40px auto;
    padding: 30px;
  }
}

/* ==========================================
   画像添付（ドラッグ＆ドロップ）エリア
   ========================================== */
.drop-zone {
  width: 100%;
  padding: 30px 20px;
  margin-top: 8px;    /* 上の「女の子を選択：」ラベルとのすき間 */
  margin-bottom: 24px; /* 下の「処理を実行する」ボタンとのすき間 */
  border: 2px dashed #00f0ff; /* ネオンシアンの破線 */
  border-radius: 20px;
  background-color: rgba(0, 240, 255, 0.03);
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease; /* アニメーションをなめらかに */
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.15);
}

/* 画像選択済み（JavaScript側で .has-file クラスが付与された時）の表示 */
.drop-zone.has-file {
  border-style: solid;
  border-color: #ff00aa; /* ネオンピンクの実線に変更 */
  background-color: rgba(255, 0, 170, 0.08);
  box-shadow: 0 0 20px rgba(255, 0, 170, 0.5), inset 0 0 10px rgba(255, 0, 170, 0.2);
}

/* 選択された画像のプレビュー表示設定 */
.drop-zone-preview {
  max-width: 100%;
  max-height: 180px;
  border-radius: 12px;
  object-fit: contain;
  box-shadow: 0 0 12px rgba(255, 0, 170, 0.6);
  margin-bottom: 8px;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

/* 選択されたファイル名のテキスト表示設定 */
.drop-zone-filename {
  font-size: 12px;
  color: #ff66cc;
  font-weight: bold;
  text-shadow: 0 0 8px rgba(255, 102, 204, 0.6);
  word-break: break-all;
  margin-top: 4px;
}

.clear-file-btn {
  margin-top: 8px;
  padding: 4px 12px;
  font-size: 11px;
  color: #ff66aa;
  background: rgba(20, 10, 30, 0.7);
  border: 1px solid #ff33aa;
  border-radius: 12px;
  cursor: pointer;
  width: auto;
  box-shadow: 0 0 6px rgba(255, 51, 170, 0.3);
  transition: all 0.2s ease;
}

.clear-file-btn:hover {
  background: rgba(255, 51, 170, 0.2);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(255, 51, 170, 0.6);
  transform: none;
  filter: none;
}

/* ドロップゾーン：ホバー・ドラッグ中 */
.drop-zone:hover {
  background-color: rgba(255, 0, 170, 0.08);
  border-color: #ff00aa;
  box-shadow: 0 0 18px rgba(255, 0, 170, 0.4);
}

.drop-zone.dragover {
  background-color: rgba(0, 240, 255, 0.12); /* 変化させて「置けるよ！」をアピール */
  border-color: #00f0ff;
  transform: scale(1.01); /* ほんの少しだけ膨らませる */
  box-shadow: 0 0 25px rgba(0, 240, 255, 0.6);
}

/* ドロップゾーン内コンテンツ */
.drop-zone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  user-select: none; /* テキストを選択不可にして操作性アップ */
}

.drop-zone-icon {
  font-size: 2.5rem;
}

.drop-zone-text {
  margin: 0;
  font-size: 15px;
  font-weight: bold;
  color: #ff33bb; /* 発光感のあるネオンピンク */
  text-shadow: 0 0 8px rgba(255, 51, 187, 0.6);
}

.drop-zone-subtext {
  margin: 0;
  font-size: 10px;
  color: #b8c7e0; /* 明るめのブルーグレー */
}

/* ヘルプリンク */
.help-btn-container {
  text-align: right;
  margin-top: -18px;
  margin-bottom: 16px;
  padding-right: 6px;
}

.help-btn {
  background: none;
  border: none;
  color: rgba(184, 199, 224, 0.45); /* 普段は存在感を消した薄いグレー */
  font-size: 11px;
  cursor: pointer;
  padding: 0;
  box-shadow: none;
  width: auto;
  text-decoration: none;
  transition: all 0.2s ease;
}
.help-btn:hover {
  color: #00f0ff; /* ホバー時のみシアンで優しく発光 */
  background: none;
  border: none;
  box-shadow: none;
  transform: none;
  filter: none;
  text-decoration: underline;
}

/* モーダル背景（画面全体を暗く覆う） */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(10, 4, 18, 0.8);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  padding: 20px;
  box-sizing: border-box;
}

.modal-overlay.hidden {
  display: none;
}

/* モーダル本体 */
.modal-content {
  background: rgba(18, 10, 32, 0.95);
  border: 1.5px solid rgba(0, 240, 255, 0.5);
  border-radius: 16px;
  width: 100%;
  max-width: 440px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 25px rgba(0, 240, 255, 0.25);
  overflow: hidden;
  color: #f3e8ff;
}

.modal-header {
  padding: 14px 18px;
  border-bottom: 1px solid rgba(0, 240, 255, 0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  margin: 0;
  font-size: 15px;
  color: #00f0ff;
  text-shadow: 0 0 8px rgba(0, 240, 255, 0.4);
}

.modal-close-x {
  background: none;
  border: none;
  color: #a0a0c0;
  font-size: 22px;
  cursor: pointer;
  padding: 0;
  width: auto;
  box-shadow: none;
  /* スマホブラウザがボタンに付与する独自のスタイルをリセットし、縦方向のズレや意図しないサイズ変更を防ぎます。 */
  appearance: none;
  -webkit-appearance: none;
  line-height: 1;
}

.modal-body {
  padding: 16px 18px;
  overflow-y: auto;
  font-size: 12px;
  line-height: 1.6;
}

.help-section {
  margin-bottom: 14px;
  padding: 10px 12px;
  border-radius: 8px;
}

.help-section.success {
  background: rgba(0, 255, 136, 0.06);
  border-left: 3px solid #00ff88;
}

.help-section.danger {
  background: rgba(255, 0, 102, 0.06);
  border-left: 3px solid #ff0066;
}

.help-section h4 {
  margin: 0 0 6px 0;
  font-size: 13px;
}

.help-section.success h4 { color: #00ff88; }
.help-section.danger h4 { color: #ff0066; }

.help-section ul {
  margin: 0;
  padding-left: 16px;
  color: #d0c0e0;
}

.help-section li {
  margin-bottom: 4px;
}

.modal-footer {
  padding: 10px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
}

.modal-close-btn {
  width: 100%;
  padding: 8px;
  font-size: 13px;
}

/* ==========================================
   5. フォーム
   ========================================== */
/* フォーム内の項目タイトル（「自分の名前：」「年齢：」「女の子を選択：」など）の設定 */
.form-group label {
  display: block;    /* 上下の余白（margin）を正しく効かせるためにブロック化 */
  font-size: 14px;
  color: #ff33aa;    /* 鮮やかなネオンピンク */
  text-shadow: 0 0 8px rgba(255, 51, 170, 0.6); /* テキストの発光効果 */
  font-weight: bold; /* タイトルを太字にして見易く */
  margin-bottom: 4px;/* タイトル直下の入力欄とのすき間を適度に引き締め */
}

/* 注意喚起テキスト用スタイル */
.input-note {
  font-size: 11px;
  color: rgba(184, 199, 224, 0.7);
  margin-left: 6px;
  font-weight: normal;
  display: inline-block;
}

/* 縦並びにしたラジオボタンの下の要素とのすき間を作る */
.form-group .form-radio-row {
  display: flex;
  flex-wrap: wrap;     /* 横幅に入りきらない場合に綺麗に下の行へ折り返す */
  align-items: center; /* 縦方向の中央を揃える */
  gap: 8px 14px;       /* 選択肢同士の上下・左右の間隔を均等に確保 */
  margin-bottom: 18px; /* 各設定項目ごとの下すき間を広げて区切り感を出す */
}

/* タイトル（「年齢：」「話し方：」など）を1行目に独立させる */
.form-group label.form-title {
  width: 100%;         /* 横幅いっぱいに広げて単独の1行目にする */
  display: block;
  margin-bottom: 2px;  /* タイトルと選択肢の間の微小なすき間 */
  cursor: default !important;
}

/* ラジオボタンの選択肢（「設定なし」「年上」などタイトル以外のテキスト）の設定 */
.form-group .form-radio-row label:not(.form-title) {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #e9d5ff;        /* 選択肢はタイトルと区別できるよう明るいラベンダー色 */
  font-weight: normal;   /* 選択肢の文字は通常の太さに変更 */
  cursor: pointer;
  font-size: 14px;
  white-space: nowrap;   /* テキストが単語の途中で勝手に改行されるのを防ぐ */
}

/* テキスト入力欄 */
.form-group input[type="text"] {
  display: block;
  max-width: 300px;        /* 広がりすぎないように上限を設定 */
  width: 100%;
  padding: 8px 12px;       /* 内側の隙間 */
  margin-top: 0;           /* 上のラベルとの重複マージンをリセット */
  margin-bottom: 16px;     /* 下の次の項目ラベルとのすき間 */
  
  font-family: inherit;    /* Zen Maru Gothicを引き継ぐ */
  font-size: 14px;
  color: #ffffff;                       /* 入力文字を白にしてクリアに見せる */
  border-radius: 8px;      /* 角を丸く */
  
  /* 上部シアン〜下部ネオンピンクの2層グラデーション枠線 */
  background: 
    linear-gradient(rgba(10, 5, 20, 0.75), rgba(10, 5, 20, 0.75)) padding-box,
    linear-gradient(180deg, #00f0ff 0%, #ff00aa 100%) border-box;
  border: 1.5px solid transparent;
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.25), inset 0 0 5px rgba(255, 0, 170, 0.15);
  
  transition: all 0.3s ease;
}

/* プレースホルダーの文字色調整 */
.form-group input[type="text"]::placeholder {
  color: rgba(220, 200, 255, 0.45);
}

/* 入力中のフォーカス時にブルー＆ピンクのネオンを強く浮かび上がらせる */
.form-group input[type="text"]:focus {
  outline: none;
  background: 
    linear-gradient(rgba(15, 8, 28, 0.85), rgba(15, 8, 28, 0.85)) padding-box,
    linear-gradient(180deg, #00f0ff 0%, #ff00aa 100%) border-box;
  box-shadow: 
    0 0 12px rgba(0, 240, 255, 0.6),
    0 0 18px rgba(255, 0, 170, 0.4);
}

/* 縦並びにしたチェックボックスの下の要素（次の項目）とのすき間を作る */
.form-group .form-checkbox-row {
  display: flex;
  margin-bottom: 14px; /* 次の項目「女の子を選択：」との間隔を適度に確保 */
}

/* チェックボックス用ラベル */
.form-group label.form-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: #ff33aa;
  font-size: 14px;
  font-weight: bold;
  text-shadow: 0 0 8px rgba(255, 51, 170, 0.6);
  user-select: none;
}

/* チェックボックス自体の大きさ・外観をネオン風にカスタマイズ */
.form-group input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  margin: 0;
  border: 1.5px solid #ff33aa;
  border-radius: 4px;
  background-color: rgba(10, 5, 20, 0.7);
  cursor: pointer;
  outline: none;
  position: relative;
  transition: all 0.2s ease-in-out;
  box-shadow: 0 0 6px rgba(255, 51, 170, 0.3);
}

/* マウスホバー時に少し光らせる */
.form-group input[type="checkbox"]:hover {
  border-color: #ff66cc;
  box-shadow: 0 0 10px rgba(255, 51, 170, 0.7);
}

/* チェックが入った時の背景と発光効果 */
.form-group input[type="checkbox"]:checked {
  background-color: #ff33aa;
  border-color: #ff66cc;
  box-shadow: 0 0 12px rgba(255, 51, 170, 0.9);
}

/* チェックが入った時のレ点マーク（擬似要素で自作） */
.form-group input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  top: 1px;
  left: 5px;
  width: 5px;
  height: 10px;
  border: solid #ffffff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* 詳細設定エリアの非表示設定 */
.settings-area.hidden {
  display: none;
}

/* 詳細設定エリアが開いた際の上すき間 */
.settings-area {
  margin-top: 15px;
  padding-top: 10px;
  border-top: 1px dashed rgba(0, 240, 255, 0.4); /* シアンの区切り線 */
}

.settings-notice {
  font-size: 10.5px;
  color: rgba(184, 199, 224, 0.7);
  margin-top: 0;
  margin-bottom: 12px;
  line-height: 1.5;
  background-color: rgba(0, 240, 255, 0.03);
  border-left: 2px solid rgba(0, 240, 255, 0.5);
  padding: 6px 10px;
  border-radius: 4px;
}

/* 詳細設定ボタンの配置コンテナ（中央寄りで控えめに配置） */
.toggle-settings-container {
  text-align: center;
  margin-top: -10px;
  margin-bottom: 20px;
}

/* 詳細設定ボタン専用の小さく控えめなデザイン */
button.toggle-settings-btn {
  width: auto;
  display: inline-block;
  padding: 4px 12px;   /* 上下4px・左右12pxに縮めてコンパクト化 */
  font-size: 11px;     /* 文字サイズを11pxに小さく設定 */
  font-weight: normal;
  color: #88f0ff;
  background: rgba(10, 5, 20, 0.5);
  border: 1px solid rgba(0, 240, 255, 0.5);
  border-radius: 20px;
  box-shadow: 0 0 6px rgba(0, 240, 255, 0.2);
  cursor: pointer;
  transition: all 0.2s ease;
}

button.toggle-settings-btn:hover {
  background: rgba(0, 240, 255, 0.15);
  color: #ffffff;
  border-color: #00f0ff;
  transform: none;
  filter: none;
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.5);
}

/* ボタン（グラデーション＆ネオンホバー） */
button { 
  width: 100%;
  padding: 12px 20px; 
  background: linear-gradient(135deg, #00d4ff 0%, #a100ff 50%, #ff00aa 100%);
  color: white; 
  border: none; 
  border-radius: 8px; 
  cursor: pointer; 
  font-size: 16px;
  font-weight: bold;
  box-shadow: 0 0 15px rgba(0, 212, 255, 0.4), 0 0 25px rgba(255, 0, 170, 0.3);
  transition: all 0.3s ease;
}

button:hover { 
  filter: brightness(1.2);
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.7), 0 0 30px rgba(255, 0, 170, 0.6);
  transform: translateY(-1px);
}

/* ボタン非活性状態の見た目 */
button:disabled {
  background: rgba(40, 25, 55, 0.6);        /* ネオンカラーを消して暗いトーンに変更 */
  color: rgba(255, 255, 255, 0.35);          /* 文字色を薄くグレーアウト */
  border: 1px solid rgba(255, 255, 255, 0.1);/* うっすらとした枠線のみ維持 */
  box-shadow: none;                          /* ネオンの発光影を消去 */
  cursor: not-allowed;                       /* マウスカーソルを禁止マークに変更 */
  transform: none;
  filter: none;
}

/* 非活性状態でのホバー演出を完全に無効化 */
button:disabled:hover {
  filter: none;
  box-shadow: none;
  transform: none;
}

@media (min-width: 600px) {
  button {
    width: auto;
  }
}

/* ステータスメッセージ */
#statusMessage {
  display: block;
  margin-top: 15px;
  padding: 10px 16px;
  font-size: 0.95rem;
  font-weight: normal;
  color: #ffffff;

  /* 非常に薄い背景 */
  background: rgba(255, 255, 255, 0.03);
  
  /* 通知エリアらしい左側のネオンアクセント線に変更 */
  border: none;
  border-left: 3px solid rgba(255, 0, 170, 0.85);
  
  /* ボタン感（カプセル感）を消すため左側を垂直、右側のみわずかな角丸に */
  border-radius: 0 6px 6px 0;
  
  /* 浮き上がる影（box-shadow）を撤去 */
  box-shadow: none;
  
  text-shadow: 0 0 10px #ff007f, 0 0 20px #ff007f; /* ピンク発光 */
  
  letter-spacing: 0.03em;
  transition: all 0.3s ease;
}

/* 全画面ローディング画面 */
#loadingOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 2, 22, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

#loadingOverlay,
#loadingOverlay * {
  font-family:
    "Hiragino Sans",
    "Hiragino Kaku Gothic ProN",
    "Yu Gothic UI",
    "Yu Gothic",
    Meiryo,
    "Noto Sans JP",
    system-ui,
    -apple-system,
    sans-serif !important;
  font-weight: 700;
  font-synthesis: none;
}

#loadingOverlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.sexy-spinner {
  width: 70px;
  height: 70px;
  border: 3px solid rgba(255, 0, 127, 0.15);
  border-top: 3px solid #ff007f;
  border-right: 3px solid #e000ff;
  border-radius: 50%;
  animation: sexySpin 1s linear infinite;
  box-shadow: 0 0 20px rgba(255, 0, 127, 0.6), inset 0 0 15px rgba(224, 0, 255, 0.4);
}

@keyframes sexySpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loader-text {
  font-family: 'Zen Maru Gothic', sans-serif;
  font-weight: 900;
  font-size: 20px;
  letter-spacing: 4px;
  color: #fff;
  text-shadow: 0 0 10px #ff007f, 0 0 20px #ff007f, 0 0 30px #e000ff;
  animation: neonPulse 1.5s ease-in-out infinite alternate;
}

.loader-subtext {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 1px;
}

.loader-progress-track {
  width: min(240px, 70vw);
  height: 6px;
  margin-top: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
  box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.35);
}

.loader-progress-bar {
  width: 0%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #00d4ff 0%, #a100ff 50%, #ff00aa 100%);
  box-shadow: 0 0 10px rgba(0, 212, 255, 0.55);
  transition: width 0.25s ease-out;
}

.loader-status {
  margin: 12px 0 0;
  font-size: 13px;
  color: #ffb6d5;
  text-align: center;
  letter-spacing: 0.04em;
  min-height: 1.4em;
}

.loader-tip {
  margin: 8px 0 0;
  font-size: 11px;
  color: rgba(200, 190, 220, 0.75);
  text-align: center;
  line-height: 1.5;
  max-width: 280px;
  min-height: 2.8em;
}

.loader-notice {
  margin-top: 14px;
  font-size: 11px;
  color: #ffb6c1;
  text-align: center;
  line-height: 1.45;
  opacity: 0.9;
}

@keyframes neonPulse {
  from { opacity: 0.8; text-shadow: 0 0 8px #ff007f, 0 0 15px #ff007f; }
  to { opacity: 1; text-shadow: 0 0 15px #ff007f, 0 0 30px #ff007f, 0 0 45px #e000ff; }
}

/* PC: 横並び / スマホ: 縦積み（自動生成の下に手動作成） */
.main-action-buttons {
  display: flex;
  flex-direction: column; /* スマホ既定: 縦積み */
  gap: 10px;
  width: 100%;
  margin-top: 4px;
}

.main-action-buttons button {
  width: 100%;
  margin: 0;
}

@media (min-width: 600px) {
  .main-action-buttons {
    flex-direction: row; /* PC: 横並び */
    justify-content: center;
    align-items: stretch;
    gap: 12px;
  }

  .main-action-buttons button {
    width: auto;
    flex: 1 1 0;
    max-width: 220px;
  }
}

/* ==========================================
   7. 結果エリア・文字編集UI
   ========================================== */

.edit-button-container {
  display: flex;
  flex-direction: column; /* 上段・下段を縦に積む */
  justify-content: center;
  align-items: stretch;
  gap: 10px;
  margin-top: 20px;
  margin-bottom: 20px;
}

/* 各段（2ボタン横並び） */
.edit-button-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  width: 100%;
}

/* 修正エリア全体のカード枠 */
.edit-area {
  margin-top: 25px;
  padding: 24px 20px;
  background: rgba(12, 6, 24, 0.65); /* メインの .container と同じ半透明ネオンガラス背景に統一 */
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1.5px solid rgba(255, 0, 170, 0.6); /* ネオンピンクの枠線（コンテナのシアンと対比） */
  border-radius: 16px;
  box-shadow: 
    0 0 15px rgba(255, 0, 170, 0.3),
    0 0 30px rgba(0, 240, 255, 0.2),
    inset 0 0 20px rgba(255, 0, 170, 0.1);
  position: relative;
  overflow: hidden;
}

/* 上部の走査線グラデーション（少し上品に調整） */
.edit-area::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, #ff00aa, #00f0ff, #ff00aa);
  background-size: 200% 100%;
  animation: cyberGlowLine 4s linear infinite;
}

@keyframes cyberGlowLine {
  0% { background-position: 0% 0%; }
  100% { background-position: 200% 0%; }
}

.edit-header {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
}

/* タイトル見出し */
.edit-title {
  font-size: 1.1rem;
  font-weight: bold;
  color: #ff33aa; /* フォームのラベルと同じネオンピンクに統一 */
  text-shadow: 0 0 8px rgba(255, 51, 170, 0.6);
  margin: 0;
  letter-spacing: 0.05em;
}

.cyber-icon {
  color: #00f0ff;
  margin-right: 6px;
  font-size: 1.1em;
  text-shadow: 0 0 8px #00f0ff;
}

/* 説明テキスト */
.edit-desc {
  font-size: 11px;
  color: rgba(184, 199, 224, 0.7); /* 他の注釈（.input-note）と統一したブルーグレー */
  text-align: center;
  margin-top: 4px;
  margin-bottom: 18px;
}

/* セリフごとのグループ枠 */
.edit-box-group {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: 12px;
  padding: 14px 14px 10px;
  margin-bottom: 14px;
  box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
  position: relative;
}

/* セリフの番号ラベル */
.edit-box-label {
  font-size: 11px;
  font-weight: bold;
  color: #00f0ff;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
  text-transform: uppercase;
  text-shadow: 0 0 6px rgba(0, 240, 255, 0.6);
  display: inline-block;
  background: rgba(0, 240, 255, 0.08);
  padding: 2px 8px;
  border-radius: 4px;
  border-left: 2.5px solid #00f0ff;
}

.edit-input-wrapper {
  margin-bottom: 8px;
}

/* 入力インプットボックス（通常のテキスト入力欄と完全にスタイルを統一） */
.edit-input {
  display: block;
  width: 100%;
  padding: 8px 12px;
  margin-top: 0;
  margin-bottom: 0;
  font-family: inherit;
  font-size: 14px;
  color: #ffffff;
  border-radius: 8px;
  background: 
    linear-gradient(rgba(10, 5, 20, 0.75), rgba(10, 5, 20, 0.75)) padding-box,
    linear-gradient(180deg, #00f0ff 0%, #ff00aa 100%) border-box;
  border: 1.5px solid transparent;
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.25), inset 0 0 5px rgba(255, 0, 170, 0.15);
  outline: none;
  transition: all 0.3s ease;
}

.edit-input::placeholder {
  color: rgba(220, 200, 255, 0.45);
}

/* フォーカス時のネオン強調 */
.edit-input:focus {
  background: 
    linear-gradient(rgba(15, 8, 28, 0.85), rgba(15, 8, 28, 0.85)) padding-box,
    linear-gradient(180deg, #00f0ff 0%, #ff00aa 100%) border-box;
  box-shadow: 
    0 0 12px rgba(0, 240, 255, 0.6),
    0 0 18px rgba(255, 0, 170, 0.4);
}

/* 更新ボタン（メインの「処理を実行する」ボタンと共通のグラデーション・挙動に統一） */
.edit-update-btn {
  flex: 1;
  max-width: 200px;
  margin-top: 0;
  padding: 10px 12px;
  background: linear-gradient(135deg, #00d4ff 0%, #a100ff 50%, #ff00aa 100%);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
  box-shadow: 0 0 15px rgba(0, 212, 255, 0.4), 0 0 25px rgba(255, 0, 170, 0.3);
  transition: all 0.3s ease;
  white-space: nowrap;
}

.edit-update-btn:hover {
  filter: brightness(1.2);
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.7), 0 0 30px rgba(255, 0, 170, 0.6);
  transform: translateY(-1px);
}

.edit-update-btn:active {
  transform: translateY(1px);
}

.edit-update-btn:disabled {
  background: rgba(40, 25, 55, 0.6);
  color: rgba(255, 255, 255, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
  filter: none;
}

@media (min-width: 600px) {
  .edit-update-btn {
    font-size: 16px;
    padding: 12px 20px;
  }
}

#positionModal .modal-content,
#stampModal .modal-content {
  display: flex;
  flex-direction: column;
  max-height: 85vh;
  overflow: hidden;
}

.position-stamp-modal-body {
  text-align: center;
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

#positionModal .modal-footer,
#stampModal .modal-footer {
  flex-shrink: 0;
}

/* 位置修正・スタンプ修正キャンバス（HTMLの canvas{display:none} を上書き） */
#positionCanvas,
#stampCanvas {
  display: inline-block;
  max-width: 100%;
  max-height: min(58vh, calc(85vh - 180px));
  border: 1px dashed #00ffcc;
  border-radius: 4px;
  cursor: crosshair;
  touch-action: none; /* キャンバス上はドラッグ優先・ページスクロールしない */
}

#positionModal .modal-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.delete-box-btn {
  flex: 1;
  width: 100%;
  max-width: 200px;
  margin-top: 0;
  margin-bottom: 0;
  padding: 10px 12px;
  background: linear-gradient(135deg, #ff3366 0%, #cc0033 100%);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
  box-shadow: 0 0 15px rgba(255, 51, 102, 0.4);
  transition: all 0.3s ease;
  white-space: nowrap;
}

.delete-box-btn:hover {
  filter: brightness(1.2);
  box-shadow: 0 0 20px rgba(255, 51, 102, 0.7);
  transform: translateY(-1px);
}

.delete-box-btn:active {
  transform: translateY(1px);
}

.delete-box-btn:disabled {
  background: rgba(40, 25, 55, 0.6);
  color: rgba(255, 255, 255, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
  filter: none;
}

@media (min-width: 600px) {
  #positionModal .modal-content {
    width: min(90vw, 720px);
    max-width: min(90vw, 720px);
    min-width: min(90vw, 560px);
  }

  #positionModal .modal-footer {
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: stretch;
    gap: 10px;
    padding-left: 12px;
    padding-right: 12px;
  }

  #positionModal .modal-footer .edit-update-btn,
  #positionModal .modal-footer .delete-box-btn {
    flex: 1 1 0;
    width: auto;
    max-width: none;
    min-width: 0;
    font-size: 13px;
    padding: 10px 8px;
    white-space: nowrap;
  }

  .delete-box-btn {
    font-size: 13px;
    padding: 10px 8px;
    margin-bottom: 0;
  }
}

.edit-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.edit-box-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.style-changed-badge {
  font-size: 11px;
  color: #00ff88;
  font-weight: bold;
  text-shadow: 0 0 6px rgba(0, 255, 136, 0.6);
  background: rgba(0, 255, 136, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(0, 255, 136, 0.4);
}

.style-change-btn {
  width: auto;
  padding: 4px 10px;
  font-size: 11px;
  background: rgba(0, 240, 255, 0.1);
  border: 1px solid rgba(0, 240, 255, 0.5);
  border-radius: 6px;
  color: #00f0ff;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 0 5px rgba(0, 240, 255, 0.2);
  white-space: nowrap;
}

.style-change-btn:hover {
  background: rgba(0, 240, 255, 0.25);
  color: #ffffff;
  border-color: #00f0ff;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
}

.style-select {
  display: block;
  width: 100%;
  padding: 8px 12px;
  font-family: inherit;
  font-size: 13px;
  color: #ffffff;
  background-color: rgba(10, 5, 20, 0.95);
  border: 1.5px solid rgba(0, 240, 255, 0.5);
  border-radius: 8px;
  outline: none;
  cursor: pointer;
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.25);
}

.style-select option {
  background-color: #120a20;
  color: #ffffff;
}

/* 各行を包むラッパー（Flexboxで横並びにする） */
.edit-line-wrapper {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
  gap: 8px;
}

/* ドラッグ中の半透明表示 */
.edit-line-wrapper.dragging {
  opacity: 0.5;
  background: rgba(255, 255, 255, 0.2);
}

/* ドラッグ用のハンドル（左端のグレーの矩形） */
.drag-handle {
  cursor: grab;
  padding: 5px 10px;
  background-color: #555;
  color: #fff;
  border-radius: 4px;
  user-select: none;
  font-weight: bold;
}
.drag-handle:active {
  cursor: grabbing;
}

/* 行削除ボタン（右端の赤いバツ印） */
.delete-line-btn {
  background: #ff4d4d;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0; /* 固定サイズにしたため、以前の余白設定をリセットします */
  border: none;
  color: white;
  font-size: 16px;
  cursor: pointer;
  padding: 5px 10px;
  border-radius: 4px;
  font-weight: bold;
  /* スマホブラウザがボタンに付与する独自のスタイルをリセットし、縦方向のズレや意図しないサイズ変更を防ぎます。 */
  appearance: none;
  -webkit-appearance: none;
  line-height: 1;
}
.delete-line-btn:hover {
  background: #ff1a1a;
}

/* 行追加ボタン（下部の緑のボタン） */
.add-line-btn {
  background: transparent;
  color: #00cc66;
  border: 2px dashed #00cc66;
  border-radius: 20px;
  padding: 6px 10px;
  cursor: pointer;
  margin-top: 10px;
  font-size: 14px;
  display: block;
  width: 100%;
  text-align: center;
  font-weight: bold;
}
.add-line-btn:hover {
  background: rgba(0, 204, 102, 0.1);
  color: #00a352;
  border-color: #00a352;
}

/* 削除確認モーダル専用のスタイル調整 */
#deleteConfirmModal .modal-content {
  max-width: 380px;
  text-align: center;
}
#deleteConfirmModal .modal-main-message {
  font-size: 1.05rem;
  font-weight: bold;
  text-align: center;
  margin: 10px 0 18px 0;
  color: #ffffff;
}
#deleteConfirmModal .modal-footer {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 8px;
}
/* 削除実行ボタン（はい）：赤〜ピンク系のグラデーション＋ネオン風発光 shadow */
.btn-yes {
  background: linear-gradient(135deg, #ff3366 0%, #cc0033 100%);
  color: #ffffff;
  border: none;
  padding: 10px 32px;
  font-size: 0.95rem;
  font-weight: bold;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 0 12px rgba(255, 51, 102, 0.35);
  transition: all 0.2s ease;
}
.btn-yes:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 18px rgba(255, 51, 102, 0.6);
}
/* キャンセルボタン（いいえ）：シックな透過ダーク＋白枠線 */
.btn-no {
  background: rgba(255, 255, 255, 0.08);
  color: #cccccc;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 10px 32px;
  font-size: 0.95rem;
  font-weight: bold;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-no:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.4);
}

/* SortableJSによるドラッグ中の要素の見た目（元の要素の残像部分） */
.sortable-ghost {
    opacity: 0.4;
    background-color: #f0f0f0;
}

/* モーダル本文のメインメッセージ */
#changeTextConfirmModal .modal-main-message {
  font-size: 1.05rem;
  font-weight: bold;
  text-align: center;
  margin: 10px 0 18px 0;
  color: #ffffff;
}

/* 注意書きをまとめる警告ボックス */
#changeTextConfirmModal .modal-warning-box {
  background: rgba(255, 76, 76, 0.08);
  border: 1px solid rgba(255, 76, 76, 0.3);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 20px;
  text-align: left;
}

/* 警告テキスト（赤色強調） */
#changeTextConfirmModal .warning-text-danger {
  color: #ff6b6b;
  font-weight: bold;
  font-size: 0.9rem;
  margin: 0 0 6px 0;
  line-height: 1.4;
}

/* 補足説明テキスト（控えめなグレー） */
#changeTextConfirmModal .warning-text-info {
  color: #a0a5b5;
  font-size: 0.82rem;
  margin: 0;
  line-height: 1.4;
}

/* モーダル下のボタンエリアの並び順と間隔 */
#changeTextConfirmModal .modal-footer {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 8px;
}

/* 主処理ボタン（はい）：水色〜青の鮮やかなグラデーション＋ネオン風シャドウ */
#changeTextConfirmModal .btn-primary {
  background: linear-gradient(135deg, #00c6ff 0%, #0072ff 100%);
  color: #ffffff;
  border: none;
  padding: 10px 32px;
  font-size: 0.95rem;
  font-weight: bold;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 0 12px rgba(0, 198, 255, 0.35);
  transition: all 0.2s ease;
}

#changeTextConfirmModal .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 18px rgba(0, 198, 255, 0.6);
}

/* キャンセルボタン（いいえ）：目立ちすぎないシックな透過ダーク＋白枠線 */
#changeTextConfirmModal .btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #cccccc;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 10px 32px;
  font-size: 0.95rem;
  font-weight: bold;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

#changeTextConfirmModal .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.4);
}

/* ==========================================
   9. 位置修正・スタンプ修正モーダル（キャンバス）
   10. スタンプ追加モーダル
   ========================================== */

.add-stamp-modal-body {
  display: flex;
  gap: 12px;
  max-height: 50vh;
  overflow: hidden;
  align-items: stretch;
}

.stamp-category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(0, 240, 255, 0.25);
}

.stamp-category-tab {
  width: auto;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: bold;
  color: #b8c7e0;
  background: rgba(10, 5, 20, 0.6);
  border: 1px solid rgba(0, 240, 255, 0.35);
  border-radius: 16px;
  cursor: pointer;
  box-shadow: none;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.stamp-category-tab:hover {
  color: #ffffff;
  border-color: #00f0ff;
  background: rgba(0, 240, 255, 0.12);
  transform: none;
  filter: none;
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.35);
}

.stamp-category-tab.active {
  color: #ffffff;
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.35) 0%, rgba(255, 0, 170, 0.35) 100%);
  border-color: #ff00aa;
  box-shadow: 0 0 10px rgba(255, 0, 170, 0.45);
}

.stamp-category-tab:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* スタンプ一覧（この領域だけ縦スクロール） */
.stamp-list-container {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 8px;
  align-content: start;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  max-height: 100%;
  padding-right: 4px;
}

/* スタンププレビュー（固定） */
.stamp-preview-container {
  flex: 0 0 120px;
  width: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  border-left: 1px solid rgba(0, 240, 255, 0.3);
  padding-left: 12px;
  overflow: hidden;
}

.stamp-preview-label {
  margin-top: 0;
  margin-bottom: 10px;
}

.stamp-preview-img {
  max-width: 100%;
  max-height: 100px;
  display: none;
  object-fit: contain;
}

/* PC: 一覧をやや狭く、プレビューを大きく */
@media (min-width: 600px) {
  .add-stamp-modal-body {
    gap: 16px;
    max-height: 55vh;
  }

  .stamp-list-container {
    grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
    gap: 8px;
  }

  .stamp-preview-container {
    flex: 0 0 180px;
    width: 180px;
    padding-left: 16px;
  }

  .stamp-preview-img {
    max-height: 160px;
  }
}

/* スタンプ一覧モーダル内の各スタンプ画像 */
.stamp-list-item {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: 8px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.03);
  transition: all 0.2s ease;
}

/* ホバー時（マウスを乗せた時）の光彩 */
.stamp-list-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(0, 240, 255, 0.4);
}

/* 選択中のスタンプ（ネオンピンクで強調） */
.stamp-list-item.selected {
  border-color: #ff00aa;
  background: rgba(255, 0, 170, 0.15);
  box-shadow: 0 0 10px rgba(255, 0, 170, 0.6);
}

.stamp-opacity-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px 4px;
  flex-shrink: 0;
  border-top: 1px solid rgba(0, 240, 255, 0.15);
}

.stamp-opacity-label {
  flex-shrink: 0;
  font-size: 12px;
  color: #00f0ff;
  font-weight: bold;
  white-space: nowrap;
}

.stamp-opacity-slider {
  flex: 1 1 auto;
  min-width: 0;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: linear-gradient(90deg, rgba(255,255,255,0.15) 0%, rgba(0,240,255,0.5) 100%);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

.stamp-opacity-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ff00aa;
  border: 2px solid #ffffff;
  box-shadow: 0 0 8px rgba(255, 0, 170, 0.6);
  cursor: pointer;
}

.stamp-opacity-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ff00aa;
  border: 2px solid #ffffff;
  box-shadow: 0 0 8px rgba(255, 0, 170, 0.6);
  cursor: pointer;
}

.stamp-opacity-slider:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.stamp-opacity-value {
  flex-shrink: 0;
  width: 3.2em;
  text-align: right;
  font-size: 12px;
  color: #e9d5ff;
  font-variant-numeric: tabular-nums;
}

/* スタンプ修正モーダル フッター */
#stampModal .modal-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

#stampModal .modal-content {
  min-width: min(90vw, 320px);
}

@media (min-width: 600px) {
  #stampModal .modal-content {
    width: min(90vw, 720px);
    max-width: min(90vw, 720px);
    min-width: min(90vw, 560px);
  }

  #stampModal .modal-footer {
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: stretch;
    gap: 10px;
    padding-left: 12px;
    padding-right: 12px;
  }

  #stampModal .modal-footer .edit-update-btn,
  #stampModal .modal-footer .delete-box-btn {
    flex: 1 1 0;
    width: auto;
    max-width: none;
    min-width: 0;
    font-size: 13px;
    padding: 10px 8px;
    white-space: nowrap;
  }
}

@media (max-width: 599px) {
  #positionModal .modal-footer,
  #stampModal .modal-footer {
    gap: 8px;
    padding: 8px 12px;
  }

  #positionModal .modal-footer .edit-update-btn,
  #positionModal .modal-footer .delete-box-btn,
  #stampModal .modal-footer .edit-update-btn,
  #stampModal .modal-footer .delete-box-btn {
    font-size: 13px;
    padding: 8px 10px;
    max-width: 100%;
  }

  #positionModal .edit-desc,
  #stampModal .edit-desc {
    font-size: 10px;
    margin-bottom: 10px;
  }
}

/* ==========================================
   12. スタンプセットUI
   ========================================== */
.stamp-set-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stamp-set-item-btn {
  width: 100%;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  text-align: left;
  font-size: 14px;
  font-weight: bold;
  color: #f3e8ff;
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.45);
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.2);
  transition: all 0.2s ease;
}

.stamp-set-item-btn:hover {
  background: rgba(255, 0, 170, 0.15);
  border-color: #ff00aa;
  box-shadow: 0 0 12px rgba(255, 0, 170, 0.4);
  transform: none;
  filter: none;
}

.stamp-set-item-label {
  font-size: 14px;
  font-weight: bold;
  color: #f3e8ff;
  line-height: 1.3;
}

.stamp-set-item-desc {
  font-size: 11px;
  font-weight: normal;
  color: rgba(184, 199, 224, 0.8);
  line-height: 1.45;
}

/* 3ボタン時も既存の縦積み/横並びルールをそのまま使う。
   PCで3つ並ぶとき幅が窮屈なら max-width を少し広げる程度で足りる */
@media (min-width: 600px) {
  .main-action-buttons button {
    max-width: 200px;
  }
}

#stampSetBtn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  line-height: 1.2;
}

#stampSetBtn .btn-main-label {
  font-size: inherit;
  font-weight: inherit;
}

#stampSetBtn .btn-sub-label {
  font-size: 10px;
  font-weight: normal;
  opacity: 0.75;
  letter-spacing: 0.02em;
}