input[type="text"] {
  width: 100%; /* 親要素に合わせる */
  max-width: 100%; /* はみ出し防止 */
  padding: 8px;
  font-size: 16px;
  box-sizing: border-box;
}
:root {
  --bg: #f6f7fb;
  --panel: #ffffff;
  --text: #1f2328;
  --muted: #6b7280;
  --accent: #2563eb; /* ボタン色（青） */
  --accent-ink: #ffffff;
  --ring: #93c5fd;
  --shadow: 0 6px 20px rgba(2, 6, 23, 0.08);
}

* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
  background: #fff;
  -webkit-overflow-scrolling: touch; /* スムーズスクロール */
}
body {
  margin: 0;
  padding: 24px 16px 40px;
  background: radial-gradient(1200px 800px at 10% -10%, rgba(255, 183, 77, 0.15), transparent 60%),
    /* オレンジ */ radial-gradient(1000px 600px at 110% -20%, rgba(255, 240, 153, 0.18), transparent 55%), var(--bg);
  color: var(--text);
  font: 16px/1 -apple-system, "Noto Sans JP", BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", "YuGothic", Meiryo, sans-serif;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  line-height: 1.4;
}

/* ページ幅・レイアウト */
body > * {
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

h1 {
  line-height: 1.4;
  font-size: 24px;
  text-align: center;
  display: block;
}

#previewCanvas {
  display: block;
  max-width: 100%;
  aspect-ratio: 1 / 1; /* 正方形を維持 */
  background: linear-gradient(135deg, #f0f2f8, #e9ecf5);
  box-shadow: var(--shadow);
  margin: 16px auto 24px; /* 中央揃え */
}

/* フォーム群 */
/* フォーム要素は親のフォントをそのまま使う */
input,
textarea,
button,
select,
label {
  font: inherit;
  line-height: inherit;
}

label {
  color: var(--muted);
  margin-right: 8px;
  display: inline-flex;
  align-items: center; /* 垂直中央 */
  gap: 8px;
}
input[type="text"] {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(2, 6, 23, 0.12);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 1px 0 rgba(2, 6, 23, 0.02) inset;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.02s;
}
input[type="text"]::placeholder {
  color: #9aa4b2;
}
input[type="text"]:focus-visible {
  border-color: var(--ring);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--ring) 30%, transparent);
}

/* カラーピッカーちょいリッチ（WebKit系中心） */
input[type="color"] {
  appearance: none;
  width: 44px;
  height: 36px;
  padding: 0;
  border: 1px solid rgba(2, 6, 23, 0.12);
  border-radius: 8px;
  background: var(--panel);
  vertical-align: middle;
}
input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 4px;
  border-radius: 8px;
}
input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 4px;
}

/* 行間スペース（既存の inline style を置き換えたい場合） */
div[style*="margin-bottom"] {
  margin-bottom: 12px !important;
}

/* ボタン */
button {
  appearance: none;
  border: none;
  border-radius: 8px;
  padding: 12px 16px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 0.06s ease, box-shadow 0.2s ease, opacity 0.2s ease, background 0.2s ease;
  box-shadow: var(--shadow);
  background-color: #0cb1c3;
  color: #ffffff;
  display: inline-flex;
  align-items: center; /* 上下中央揃え */
  gap: 8px; /* テキストとの間隔 */
  font-size: 16px;
}

button .material-symbols-outlined,
label .material-symbols-outlined {
  font-size: 20px; /* 好きな大きさ */
  line-height: 1; /* 余白を消す */
  display: inline-block;
  vertical-align: middle;
  font-variation-settings: "FILL" 0, "wght" 600, /* ボタンの太字に合わせる（400でもOK） */ "GRAD" 0, "opsz" 20; /* ← font-sizeと同じ数値に！ */
}

#shareBtn,
#openTab {
  background-color: #0cb1c3;
}

button + button {
  margin-left: 8px;
}

/* ホバー/アクティブ/無効 */
button:hover {
  transform: translateY(-1px);
}
button:active {
  transform: translateY(0) scale(0.99);
}
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.txtbox {
  margin-bottom: 8px;
}

/* 視覚的に隠す（スクリーンリーダーOK） */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

#catchphrase {
  width: 100%;
  resize: vertical; /* サイズ変更可（不要ならnone） */
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid rgba(2, 6, 23, 0.12);
  font-size: 16px;
}

/* ラッパー */
.file-input {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  text-align: center;
}

/* ボタン：オレンジ→ピンクのふんわり */
.file-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 8px;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: #f99f48;
  color: #fff;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.06s ease, box-shadow 0.2s ease, filter 0.2s ease;
  user-select: none;
}
.file-button:hover {
  transform: translateY(-1px);
}
.file-button:active {
  transform: translateY(0) scale(0.99);
}

/* アイコン大きめ */
.file-button .icon {
  font-size: 18px;
  line-height: 1;
}

/* 選択中のファイル名 */
.file-name {
  min-height: 20px;
  color: var(--muted);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.unit-button {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}
.normal-link {
  margin-top: 40px;
  text-align: center;
  a,
  a:link,
  a:visited {
    width: 100%;
    color: gray;
    border-radius: 8px;
    text-align: center;
  }
}

/* スマホはボタンを幅100%に */
@media (max-width: 480px) {
  .file-button {
    width: 100%;
    justify-content: center;
  }
  .file-name {
    width: 100%;
  }
}

/* スペーシング調整（スマホ） */
@media (max-width: 480px) {
  body {
    padding: 16px 16px 48px;
  }
  button {
    width: 100%;
    margin: 8px 0 0;
  }
  button + button {
    margin-left: 0;
  }
}
