/* sukigao.css — 好き顔診断 共通スタイル v2（モバイルファースト） */

:root {
  --brand: #C93A54;
  --ink: #2b2b2b;
  --muted: #6f6a66;
  --bg: #FBF7F2;
  --line: #eee2da;
  --accent: #555;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
}

.wrap { max-width: 720px; margin: 0 auto; padding: 12px 12px 48px; }

/* ヘッダー（首屏にメンバーを出すためコンパクトに） */
.site-header { text-align: center; padding: 14px 0 4px; }
.site-header h1 { font-size: 1.5rem; font-weight: 900; margin: 0; letter-spacing: .02em; }
.subtitle { margin: .2em 0 0; color: var(--muted); font-size: .85rem; }

/* ツール外枠 */
.tool {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .06);
  padding: 12px;
  margin-top: 10px;
}

/* 設定バー（1行：形式 + 絞り込み + 診断） */
.setting-bar { display: flex; align-items: center; gap: 8px; }
.setting-bar .seg { flex: 0 0 auto; }

.seg { display: flex; border: 2px solid var(--brand); border-radius: 999px; overflow: hidden; }
.seg-btn {
  min-height: 44px; padding: 0 16px; border: 0; background: #fff;
  color: var(--brand); font-weight: 700; font-size: .95rem; cursor: pointer;
  font-family: inherit;
}
.seg-btn.is-active { background: var(--brand); color: #fff; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chips[hidden] { display: none; }
.chip {
  min-height: 44px; padding: 0 14px; border-radius: 999px;
  border: 2px solid var(--accent); background: #fff; color: var(--accent);
  font-weight: 700; font-size: .85rem; cursor: pointer; font-family: inherit;
  transition: background .15s ease, color .15s ease;
}
.chip.is-on { background: var(--accent); color: #fff; }

/* ボタン共通 */
.btn {
  min-height: 48px; border-radius: 12px; border: 0; padding: 0 20px;
  font-size: 1.05rem; font-weight: 700; cursor: pointer; font-family: inherit;
  transition: transform .12s ease, opacity .12s ease;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .4; cursor: default; }
.btn-sm { min-height: 44px; padding: 0 14px; font-size: .85rem; border-radius: 999px; white-space: nowrap; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-secondary { background: #fff; color: var(--brand); border: 2px solid var(--brand); }
.btn-ghost { background: transparent; color: var(--muted); border: 2px solid var(--line); }
#filter-btn.is-open { background: var(--brand); color: #fff; }

/* ステージ */
.stage { margin-top: 10px; }
.stage-hint { text-align: center; color: var(--muted); padding: 24px 8px; margin: 0; }
.stage-note { text-align: center; color: var(--muted); font-size: .85rem; margin: 8px 0; }
.stage-actions { margin-top: 12px; }
.stage-actions .btn { width: 100%; }

/* 名次槽（上部固定・紧凑胶囊・自动换行・タップで交換） */
.slots-bar {
  position: sticky; top: 0; z-index: 20;
  background: #fff; margin: 0 -12px; padding: 6px 8px;
  border-bottom: 1px solid var(--line);
  max-height: 96px; overflow: hidden;
}
.slots-row { display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; }
.slot {
  display: inline-flex; align-items: center; gap: 2px;
  min-height: 28px; padding: 0 5px;
  border: 1.5px solid var(--line); border-radius: 999px; background: #faf6f2;
  cursor: pointer; font-family: inherit;
  transition: background .12s ease, border-color .12s ease;
}
.slot-rank { font-size: .55rem; color: var(--muted); font-weight: 700; }
.slot-name {
  font-size: .66rem; font-weight: 700; max-width: 2.6em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.slot.is-sel { background: var(--brand); border-color: var(--brand); }
.slot.is-sel .slot-rank, .slot.is-sel .slot-name { color: #fff; }

/* メンバーカード（名前カード） */
.pick-group h3 {
  font-size: .9rem; margin: 12px 0 6px;
  border-left: 4px solid var(--accent); padding-left: 8px;
}
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cards-two { grid-template-columns: repeat(2, 1fr); }
.card {
  position: relative; min-height: 56px; padding: 8px 4px;
  border: 2px solid var(--accent); border-radius: 12px; background: #fff;
  color: var(--ink); font-weight: 700; font-size: .85rem; cursor: pointer;
  font-family: inherit; line-height: 1.3;
  transition: transform .15s ease, background .15s ease, color .15s ease;
}
.card-big { min-height: 72px; font-size: 1rem; }
.card.is-picked { background: var(--accent); color: #fff; animation: pop .18s ease; }
.rank-badge {
  position: absolute; top: -9px; left: -6px; z-index: 2;
  background: var(--brand); color: #fff; border-radius: 999px;
  min-width: 26px; height: 24px; padding: 0 6px;
  font-size: .72rem; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}
.card-group { display: block; font-size: .68rem; font-weight: 500; opacity: .85; margin-top: 2px; }

/* メンバーカード（写真版）：正方形・ cover・下部渐变に名前 */
.card-photo {
  aspect-ratio: 1 / 1; min-height: 0; padding: 0; overflow: hidden;
  border: 2px solid var(--accent);
}
.card-photo img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; display: block;
}
.photo-label {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 20px 6px 6px; text-align: left;
  background: linear-gradient(rgba(0,0,0,0), rgba(0,0,0,.68));
  color: #fff;
}
.photo-name { display: block; font-weight: 900; font-size: .82rem; line-height: 1.25; }
.photo-group { display: block; font-size: .62rem; font-weight: 500; opacity: .9; }
.card-photo.is-picked { background: #fff; }
.card-photo.is-picked img { opacity: .55; }

/* 診断モード */
.progress { height: 8px; background: #f0e6de; border-radius: 999px; overflow: hidden; }
.progress > div { height: 100%; background: var(--brand); transition: width .3s ease; }
.step-text { text-align: center; font-size: .85rem; font-weight: 700; color: var(--ink); margin: 6px 0 0; }
.step-sub { text-align: center; font-size: .75rem; color: var(--muted); margin: 2px 0 0; }
.b-question { text-align: center; font-weight: 700; font-size: .95rem; margin: 12px 0 8px; }
.b-actions { display: flex; gap: 10px; margin-top: 12px; }
.b-actions .btn { flex: 1; }

/* 結果：タイトル → シェア系ボタン → 画像 → もう一度 */
.result-title { text-align: center; font-size: 1.3rem; margin: 8px 0 4px; }
.result-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0; }
.btn-share { grid-column: 1 / -1; background: #000; color: #fff; font-size: 1.15rem; min-height: 54px; }
.canvas-wrap { margin-top: 4px; }
.canvas-wrap canvas, .canvas-wrap img {
  width: 100%; height: auto; display: block;
  border: 1px solid var(--line); border-radius: 12px;
}
.save-hint { text-align: center; }
.btn-again { width: 100%; margin-top: 12px; }

/* 本文セクション */
.content { margin-top: 36px; }
.content h2 { font-size: 1.25rem; border-bottom: 2px solid var(--line); padding-bottom: 6px; }
.content p { margin: .6em 0; }
.steps { padding-left: 1.4em; }
.steps li { margin-bottom: .5em; }

.member-group h3 {
  font-size: 1rem; margin: 14px 0 4px;
  border-left: 4px solid var(--accent); padding-left: 8px;
}
.member-group p { margin: 0; color: #444; }

.faq-item { border-bottom: 1px solid var(--line); padding: 10px 0; }
.faq-item summary { font-weight: 700; cursor: pointer; min-height: 44px; padding-top: 10px; }
.faq-item p { margin: 8px 0 4px; }

.other-links { list-style: none; padding: 0; margin: 0; }
.other-links li { margin-bottom: 8px; }
.other-links a {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 48px; padding: 8px 14px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  color: var(--ink); text-decoration: none; font-weight: 700;
}
.soon { font-size: .72rem; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; }

/* フッター */
.site-footer {
  margin-top: 48px; padding-top: 16px; border-top: 1px solid var(--line);
  text-align: center; color: var(--muted); font-size: .8rem;
}
.site-footer p { margin: .3em 0; }
.usage-notes {
  text-align: left; background: #fff; border: 1px solid var(--line);
  border-radius: 12px; padding: 14px 16px; margin-bottom: 16px;
}
.usage-notes h2 { font-size: .95rem; margin: 0 0 6px; color: var(--ink); }
.usage-notes p { font-size: .78rem; }

/* 小屏：设置行压縮，保证一行放下且不横向溢出 */
@media (max-width: 480px) {
  .setting-bar { gap: 6px; }
  .seg-btn { min-height: 40px; padding: 0 10px; font-size: .82rem; }
  .btn-sm { min-height: 40px; padding: 0 10px; font-size: .78rem; }
}

/* 軽量アニメーション */
@keyframes pop {
  0% { transform: scale(.92); }
  60% { transform: scale(1.04); }
  100% { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
