/* ============================================================
   画像を粗さを抑えて拡大ぎんぺい — style.css
   ============================================================ */

/* ── リセット ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── デザイントークン ── */
:root {
  /* カラー */
  --bg:           #FDF4EA;
  --surface:      #FFFFFF;
  --surface2:     #F5EAD8;
  --border:       rgba(73,167,206,0.15);
  --border2:      rgba(73,167,206,0.30);
  --text:         #2C2C2C;
  --muted:        #7A7A7A;
  --accent:       #49A7CE;
  --accent-dark:  #3388AD;
  --accent-light: rgba(73,167,206,0.10);
  --accent-glow:  rgba(73,167,206,0.20);
  --success:      #2DA870;
  --warning:      #D48A10;
  --danger:       #D64545;
  --success-bg:   rgba(45,168,112,0.09);
  --warning-bg:   rgba(212,138,16,0.09);
  --danger-bg:    rgba(214,69,69,0.09);

  /* 角丸 */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

/* ── ベース ── */
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Noto Sans JP', sans-serif;
  font-weight: 400;
  min-height: 100vh;
  line-height: 1.7;
}

/* ============================================================
   ヘッダー
   ============================================================ */
header {
  background: var(--surface);
  border-bottom: 1px solid var(--border2);
  padding: 0 2rem;
}

.header-inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 1.2rem 0;
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-link {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
}

.logo-img {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: block;
}

.logo-text {
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.logo-text small {
  display: block;
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--muted);
  font-family: 'Noto Sans JP', sans-serif;
  letter-spacing: 0;
}

.header-free-badge {
  background: var(--accent);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  padding: 0.28rem 0.75rem;
  border-radius: 999px;
  white-space: nowrap;
  font-family: 'Noto Sans JP', sans-serif;
}

.header-usage-count {
  margin-left: auto;
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--muted);
  font-family: 'Noto Sans JP', sans-serif;
  white-space: nowrap;
}

.header-usage-count strong {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  color: var(--accent-dark);
}

/* ============================================================
   ヒーロー
   ============================================================ */
.hero {
  background: linear-gradient(135deg, #FDF4EA 0%, #FEF1DA 50%, #FDF4EA 100%);
  border-bottom: 2px solid rgba(73,167,206,0.15);
  padding: 2.8rem 2rem 0;
  overflow: hidden;
}

.hero-inner {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  align-items: flex-end;
  gap: 1rem;
}

.hero-text {
  flex: 1;
  padding-bottom: 2.5rem;
}

.hero h1 {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(1.5rem, 4vw, 2.1rem);
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  letter-spacing: -0.02em;
  margin-bottom: 0.9rem;
}

.hero h1 em {
  font-style: normal;
  color: var(--accent);
}

.hero-lead {
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.8;
  max-width: 480px;
  margin-bottom: 1.4rem;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.hero-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  background: #fff;
  border: 1px solid var(--border2);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  font-size: 0.8rem;
  color: var(--text);
  font-weight: 500;
}

.badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #AAAAAA;
  flex-shrink: 0;
  display: inline-block;
}

.hero-chara {
  flex-shrink: 0;
  width: 300px;
  height: 300px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
}

.hero-chara img {
  width: 300px;
  height: 300px;
  object-fit: contain;
  object-position: bottom;
  display: block;
}

/* ============================================================
   拡大ツール本体
   ============================================================ */
.tool-section {
  max-width: 860px;
  margin: 0 auto;
  padding: 2.5rem 2rem;
}

.tool-heading {
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tool-heading::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 1.1em;
  background: var(--accent);
  border-radius: 2px;
  flex-shrink: 0;
}

/* 入力カード */
.input-card {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  padding: 2rem 2.25rem;
  box-shadow: 0 2px 16px rgba(73,167,206,0.07);
}

.input-card h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.3rem;
  letter-spacing: -0.01em;
}

.input-card .sub {
  color: var(--muted);
  font-size: 0.875rem;
  margin-bottom: 1.75rem;
}

.field-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.45rem;
}

/* ドロップゾーン */
.dropzone {
  border: 2px dashed var(--border2);
  border-radius: var(--radius-md);
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  background: var(--bg);
}

.dropzone:hover,
.dropzone.drag-over {
  border-color: var(--accent);
  background: var(--accent-light);
}

.dropzone-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

.dropzone-text {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.dropzone-or {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.85rem;
}

.btn-upload {
  display: inline-block;
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 0.55rem 1.5rem;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-upload:hover { background: var(--accent-dark); }

.dropzone-note {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.85rem;
}

/* 設定パネル */
.settings-panel {
  margin-top: 1.5rem;
}

.preview-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.preview-box {
  flex-shrink: 0;
  width: 80px;
  height: 80px;
  background: var(--surface2);
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border2);
}

.preview-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.preview-info {
  flex: 1;
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.6;
  white-space: pre-line;
}

.btn-change {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.9rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}

.btn-change:hover { background: var(--border2); }

.controls-wrap {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.control-group {}

/* 拡大サイズ選択 */
.scale-options {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.45rem;
}

.scale-option { flex: 1; }

.scale-option input[type="radio"] { display: none; }

.scale-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: 1px solid var(--border2);
  border-radius: var(--radius-md);
  padding: 1rem 0.5rem;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  background: var(--bg);
}

.scale-option input[type="radio"]:checked + .scale-btn {
  border-color: var(--accent);
  border-width: 2px;
  background: var(--accent-light);
}

.scale-num {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--accent-dark);
  line-height: 1;
}

.scale-unit {
  font-size: 0.95rem;
  font-weight: 600;
}

.scale-desc {
  font-size: 0.72rem;
  color: var(--muted);
}

/* 出力形式 */
.format-options {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.45rem;
}

.format-option input[type="radio"] { display: none; }

.format-btn {
  display: block;
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 0.88rem;
  padding: 0.5rem 1.5rem;
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: var(--bg);
  color: var(--text);
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.format-option input[type="radio"]:checked + .format-btn {
  border-color: var(--accent);
  border-width: 2px;
  background: var(--accent);
  color: #fff;
}

/* サイズ目安表示 */
.size-estimate {
  background: var(--surface2);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.size-estimate-label {
  font-size: 0.82rem;
  color: var(--muted);
}

.size-estimate-value {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--accent-dark);
}

/* 実行ボタン */
.btn-run {
  width: 100%;
  padding: 0.9rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  letter-spacing: 0.03em;
  transition: background 0.15s, transform 0.1s;
}

.btn-run:hover  { background: var(--accent-dark); }
.btn-run:active { transform: scale(0.99); }
.btn-run:disabled { opacity: 0.45; cursor: not-allowed; }

/* ローディング */
#loading {
  display: none;
  margin-top: 1.5rem;
}

.loading-card {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  text-align: center;
  box-shadow: 0 2px 16px rgba(73,167,206,0.07);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto 1.25rem;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.3rem;
  min-height: 1.5em;
  transition: opacity 0.2s;
}

.loading-sub {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 1.25rem;
}

.progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
  max-width: 320px;
  margin: 0 auto;
}

.progress-fill {
  height: 100%;
  border-radius: 99px;
  background: var(--accent);
  transition: width 0.4s cubic-bezier(0.16,1,0.3,1);
}

.loading-pct {
  font-family: 'Outfit', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-dark);
  margin-top: 0.6rem;
}

/* 結果エリア */
#results {
  display: none;
  margin-top: 2rem;
}

.results-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.results-header h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

/* スタッツカード */
.score-bar-wrap {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  box-shadow: 0 2px 12px rgba(73,167,206,0.06);
  flex-wrap: wrap;
}

.result-stat-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: center;
}

.result-stat-label {
  font-size: 0.78rem;
  color: var(--muted);
}

.result-stat-value {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
}

.result-stat-value.accent {
  color: var(--accent-dark);
}

.result-arrow {
  font-size: 1.2rem;
  color: var(--muted);
}

/* 比較グリッド */
.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.compare-label {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 0.5rem;
  text-align: center;
}

.compare-img-wrap {
  background: var(--surface2);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 4/3;
  border: 1px solid var(--border);
}

.compare-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ダウンロード・リセット */
.result-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn-download {
  flex: 1;
  display: block;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  background: var(--success);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 0.9rem 1.5rem;
  text-align: center;
  transition: opacity 0.15s;
  text-decoration: none;
}

.btn-download:hover { opacity: 0.88; }

.btn-reset {
  font-family: 'Noto Sans JP', sans-serif;
  font-weight: 500;
  font-size: 0.88rem;
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1.25rem;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}

.btn-reset:hover { background: var(--border2); }

/* ============================================================
   コンテンツセクション（できること・使用例）
   ============================================================ */
.content-section {
  max-width: 860px;
  margin: 0 auto;
  padding: 3rem 2rem;
  border-top: 1px solid var(--border);
}

.section-heading {
  font-family: 'Outfit', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-heading::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 1.2em;
  background: var(--accent);
  border-radius: 2px;
  flex-shrink: 0;
}

.section-lead {
  color: var(--muted);
  font-size: 0.875rem;
  margin-bottom: 1.75rem;
}

/* できることグリッド */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.35rem;
  transition: box-shadow 0.15s;
}

.feature-card:hover {
  box-shadow: 0 4px 16px rgba(73,167,206,0.10);
}

.feature-icon {
  font-size: 1.5rem;
  margin-bottom: 0.6rem;
}

.feature-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.4rem;
}

.feature-desc {
  font-size: 0.83rem;
  color: var(--muted);
  line-height: 1.65;
}

/* 使用例リスト */
.usecase-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.usecase-item {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.35rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.usecase-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  margin-top: 1px;
}

.usecase-body strong {
  display: block;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.3rem;
}

.usecase-body p {
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.65;
  margin: 0;
}

/* ============================================================
   フッター
   ============================================================ */
footer {
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
  padding: 2rem;
  border-top: 1px solid var(--border2);
}

/* ============================================================
   レスポンシブ
   ============================================================ */
@media (max-width: 600px) {
  .hero h1 { font-size: 1.4rem; }
  .hero-chara { display: none; }
  .features-grid { grid-template-columns: 1fr; }
  .compare-grid { grid-template-columns: 1fr; }
  .scale-options { gap: 0.5rem; }
  .scale-num { font-size: 1.15rem; }
  .result-actions { flex-direction: column; }
  .score-bar-wrap { gap: 1rem; justify-content: center; }
  .result-arrow { display: none; }
  .preview-row { flex-wrap: wrap; }
  .header-usage-count { display: none; }
}

/* ============================================================
   開発コスト表
   ============================================================ */
.cost-table-wrap {
  overflow-x: auto;
}

.cost-table {
  width: 100%;
  max-width: 480px;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.cost-table th,
.cost-table td {
  padding: 0.7rem 1.1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.cost-table th {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  color: var(--muted);
  background: var(--surface2);
  text-transform: uppercase;
}

.cost-table td:nth-child(2),
.cost-table td:nth-child(3) {
  text-align: right;
}

.cost-table th:nth-child(2),
.cost-table th:nth-child(3) {
  text-align: right;
}

.cost-table-total td {
  font-weight: 600;
  color: var(--text);
  background: var(--accent-light);
  border-top: 2px solid var(--border2);
  border-bottom: none;
}
