:root {
  --accent: #8a76a8;
  --accent-dark: #5f4d7a;
  --bg: linear-gradient(160deg, #fdf3f7 0%, #f2ecfb 45%, #eaf4f4 100%);
  --text: #2f2a33;
  --muted: #7a7280;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

html, body { height: 100%; }

body {
  margin: 0;
  font-family: "Yu Gothic", "Hiragino Sans", sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  touch-action: manipulation;
}

#app {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3vmin;
}

.card {
  width: 100%;
  max-width: 900px;
  background: #fff;
  border-radius: 32px;
  padding: 44px 48px;
  box-shadow: 0 12px 40px rgba(90, 70, 110, 0.14);
  text-align: center;
}

h1 { font-size: 46px; margin: 0 0 14px; color: var(--accent-dark); letter-spacing: 0.04em; }
h2 { font-size: 34px; line-height: 1.5; margin: 6px 0 28px; }
h3 { font-size: 26px; color: var(--accent-dark); margin: 0 0 8px; }
p { font-size: 22px; line-height: 1.7; margin: 8px 0; }

.lead { color: var(--muted); font-size: 26px; margin: 0 0 36px; }

.progress { font-size: 20px; color: var(--muted); margin: 0 0 4px; }
.dots { display: flex; justify-content: center; gap: 10px; margin-bottom: 18px; }
.dots span { width: 14px; height: 14px; border-radius: 50%; background: #e3d9ee; }
.dots span.on { background: var(--accent); }

.btn {
  display: block;
  width: 100%;
  padding: 26px 20px;
  border-radius: 22px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 28px;
  font-family: inherit;
  cursor: pointer;
}
.btn:active { transform: scale(0.98); opacity: 0.9; }
.btn.start { font-size: 34px; padding: 34px 20px; }

.options { display: flex; flex-direction: column; gap: 16px; }
.btn.opt {
  background: #f7f3fb;
  color: var(--text);
  border: 2px solid #e3d9ee;
}
.btn.opt:active { background: #efe6f7; }

/* 色の選択：丸いサンプル付きのグリッド */
.options.colors { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.btn.color { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 22px 8px; font-size: 24px; }
.swatch { width: 64px; height: 64px; border-radius: 50%; border: 2px solid rgba(0,0,0,0.08); }

.options.nuance { display: grid; grid-template-columns: repeat(2, 1fr); }

.result .stone {
  border-top: 2px solid #f0eaf6;
  padding: 20px 0;
}
.result .stone:first-of-type { border-top: none; }
.result .label { font-size: 20px; color: var(--muted); margin: 0; }
.result .stone h3 { font-size: 38px; margin: 4px 0 6px; }
.care { font-size: 18px; color: #a06a6a; background: #fdf1f1; padding: 10px 14px; border-radius: 12px; }

.result-grid { display: grid; grid-template-columns: 1fr; gap: 20px; }
.line-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 22px 20px;
  background: #f4fbf6;
  border: 2px solid #cfe9d6;
  border-radius: 24px;
}
.line-box img { width: 200px; height: 200px; border-radius: 12px; background: #fff; }
.line-box p { margin: 6px 0; font-size: 20px; }
.line-box .big { font-size: 28px; font-weight: bold; color: #2a7d46; margin-top: 14px; }

.btn.next { margin-top: 20px; padding: 20px; font-size: 24px; background: transparent; color: var(--accent-dark); border: 2px solid var(--accent); }

/* 横向きiPad：結果は左に石、右にQRを並べて1画面に収める */
@media (min-width: 900px) {
  .options.colors { grid-template-columns: repeat(7, 1fr); gap: 12px; }
  .btn.color { padding: 16px 4px; font-size: 20px; }
  .swatch { width: 56px; height: 56px; }
  .card.result { max-width: 1120px; padding: 30px 44px; }
  .result h2 { font-size: 30px; margin-bottom: 8px; }
  .result-grid { grid-template-columns: 1.25fr 1fr; align-items: center; gap: 32px; }
  .result .stone { padding: 12px 0; text-align: left; }
  .result .stone h3 { font-size: 32px; }
  .result p { font-size: 19px; line-height: 1.55; }
  .result .label { font-size: 17px; }
}

/* 縦向きのiPadや狭い画面向け */
@media (max-width: 760px) {
  .card { padding: 28px 22px; }
  h1 { font-size: 34px; }
  h2 { font-size: 26px; }
  .options.colors { grid-template-columns: repeat(3, 1fr); }
}

/* ===== 性格診断型 ===== */
.btn.start + .btn.opt, .options .btn.start { margin: 0; }
.progress .who { color: var(--accent-dark); font-weight: bold; }

.card.q h2 { font-size: 36px; margin: 8px 0 26px; }
.statements { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.stmt {
  padding: 26px 22px;
  border-radius: 22px;
  font-size: 26px;
  line-height: 1.55;
  min-height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.stmt.l { background: #f1ecf8; color: var(--accent-dark); border: 2px solid #ddd0ee; }
.stmt.r { background: #e9f4f4; color: #2f6b6b; border: 2px solid #c9e3e3; }

/* 4段階の丸ボタン：外側ほど大きい */
.scale { display: flex; align-items: center; justify-content: center; gap: 28px; margin-top: 28px; }
.dot { border-radius: 50%; border: 4px solid; background: #fff; cursor: pointer; padding: 0; }
.dot:active { transform: scale(0.92); }
.dot.s0 { width: 96px; height: 96px; border-color: var(--accent); }
.dot.s1 { width: 68px; height: 68px; border-color: #b9a9d0; }
.dot.s2 { width: 68px; height: 68px; border-color: #8fc2c2; }
.dot.s3 { width: 96px; height: 96px; border-color: #3f9b9b; }
.dot.s0:active { background: var(--accent); }
.dot.s1:active { background: #b9a9d0; }
.dot.s2:active { background: #8fc2c2; }
.dot.s3:active { background: #3f9b9b; }
.scale-cap { display: flex; justify-content: center; gap: 28px; margin-top: 8px; color: var(--muted); font-size: 18px; }
.scale-cap span:nth-child(1), .scale-cap span:nth-child(4) { width: 96px; }
.scale-cap span:nth-child(2), .scale-cap span:nth-child(3) { width: 68px; }
.back {
  margin-top: 22px; background: none; border: none; color: var(--muted);
  font-size: 20px; font-family: inherit; padding: 10px 18px; cursor: pointer;
}

/* 結果 */
.result .label { text-align: left; }
.typename { font-size: 44px; margin: 4px 0 14px; text-align: left; color: var(--accent-dark); }
.typename small { font-size: 22px; color: var(--muted); margin-left: 16px; letter-spacing: 0.1em; font-weight: normal; }
.typename.pair { font-size: 34px; }
.typename em { font-style: normal; color: var(--muted); margin: 0 12px; }
.result .result-main { text-align: left; }
.quote { color: var(--accent-dark); font-weight: bold; margin: 0 0 6px; }
.stone-card { margin-top: 14px; padding: 16px 20px; background: #f7f3fb; border-radius: 18px; }
.stone-card h3 { font-size: 32px; margin: 2px 0; }
.stone-card .others { font-size: 17px; color: var(--muted); }
.pair-stones { font-size: 28px; font-weight: bold; color: var(--accent-dark); }

.meters { display: flex; flex-direction: column; gap: 22px; justify-content: center; }
.meter-labels { display: flex; justify-content: space-between; font-size: 20px; color: var(--muted); margin-bottom: 6px; }
.meter-labels .win { color: var(--accent-dark); font-weight: bold; }
.meter-bar { position: relative; height: 12px; border-radius: 6px; background: linear-gradient(90deg, #8a76a8, #e9e3f2 50%, #8a76a8); }
.meter-bar i { position: absolute; top: 50%; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%; background: #fff; border: 5px solid var(--accent-dark); }

.btn.next-step { margin-top: 20px; padding: 22px; font-size: 26px; }

@media (min-width: 900px) {
  .card.q { max-width: 1000px; }
  .card.result { max-width: 1120px; }
  .result-grid { grid-template-columns: 1.35fr 1fr; align-items: center; }
  .typename { font-size: 42px; margin: 0 0 8px; }
  .result .stone-card p { font-size: 19px; }
}
@media (max-width: 760px) {
  .stmt { min-height: 0; font-size: 19px; padding: 18px 12px; }
  .scale, .scale-cap { gap: 16px; }
  .dot.s0, .dot.s3 { width: 78px; height: 78px; }
  .dot.s1, .dot.s2 { width: 56px; height: 56px; }
  .scale-cap span:nth-child(1), .scale-cap span:nth-child(4) { width: 78px; }
  .scale-cap span:nth-child(2), .scale-cap span:nth-child(3) { width: 56px; }
  .card.q h2 { font-size: 28px; }
  .typename { font-size: 34px; }
}
.how { margin: 18px 0 0; font-size: 19px; color: var(--muted); }
.stmt.l::before, .stmt.r::before { content: ""; }

/* カテゴリ選択 */
.options.cats { gap: 16px; }
.btn.cat { padding: 30px 20px; }
.btn.cat b { display: block; font-size: 32px; color: var(--accent-dark); margin-bottom: 6px; }
.btn.cat small { display: block; font-size: 19px; color: var(--muted); }

/* LINE：友だち追加QR＋結果を送るQR */
.line-box .big { margin: 0 0 12px; }
.qr-pair { display: flex; gap: 22px; justify-content: center; }
.qr-item { text-align: center; }
.qr-item img, .qr-svg svg { width: 180px; height: 180px; border-radius: 10px; background: #fff; display: block; margin: 0 auto; }
.qr-item p { margin: 8px 0 0; font-size: 20px; }
.qr-item b { color: #2a7d46; }
.line-btn { display: block; margin: 6px auto 0; padding: 16px 28px; max-width: 320px; text-align: center; border-radius: 999px; background: #06c755; color: #fff; font-size: 20px; font-weight: bold; text-decoration: none; }
@media (max-width: 760px) { .btn.opt.color { font-size: 18px; padding: 14px 2px; white-space: nowrap; } .btn.opt.color .swatch { width: 48px; height: 48px; } }
.sub-note { display: block; font-size: 16px; font-weight: normal; opacity: 0.75; margin-top: 4px; }
.btn.start .sub-note { font-size: 18px; margin-top: 8px; }
.or-line { text-align: center; color: var(--muted); font-size: 20px; margin: 14px 0 2px; }
.swatch.inline { display: inline-block; width: 36px; height: 36px; vertical-align: middle; margin-right: 12px; }
.picked-chip { text-align: center; margin: 0 0 8px; padding: 8px 14px; border-radius: 999px; background: #f3edf9; color: var(--accent-dark); font-size: 20px; }
.btn.start.choose { margin: 18px 0 12px; font-size: 26px; padding: 22px 16px; }
.stone-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.stone-tile { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px; border: 2px solid #f0eaf6; border-radius: 16px; background: #fff; font-family: inherit; font-size: 20px; color: inherit; cursor: pointer; }
.stone-tile img { width: 96px; height: 96px; object-fit: contain; border-radius: 10px; }
.stone-tile:active { background: #efe6f7; }
.stone-photo.big { width: 200px; height: 200px; }
.meaning.center { text-align: center; }
.stone-oshi { text-align: center; color: var(--muted); font-size: 20px; line-height: 1.7; margin: 8px 0 16px; }
@media (max-width: 760px) { .stone-grid { grid-template-columns: repeat(2, 1fr); } .stone-tile img { width: 110px; height: 110px; } }
.stone-photo { display: block; width: 120px; height: 120px; object-fit: contain; margin: 4px auto 8px; border-radius: 12px; }
.line-btn.order { margin-top: 12px; background: #8a76a8; }
.qr-note { font-size: 16px !important; color: var(--muted); text-align: center; margin-top: 12px !important; }
@media (max-width: 760px) { .qr-item img, .qr-svg svg { width: 140px; height: 140px; } }

/* 最後の画面：石の名前を大きく、説明文は全部 */
.card.result.final { max-width: 1120px; text-align: left; }
.final .label.center { text-align: center; margin: 0; }
.final .pair-stones { text-align: center; font-size: 42px; margin: 4px 0 22px; color: var(--accent-dark); }
.final .pair-stones em { font-style: normal; color: var(--muted); margin: 0 18px; }
.persons { display: grid; grid-template-columns: 1fr; gap: 20px; }
.persons.two { grid-template-columns: 1fr 1fr; }
.person-card { background: #f7f3fb; border-radius: 22px; padding: 22px 26px; }
.person-card .label { margin: 0; }
.person-card .stone-big { font-size: 36px; margin: 2px 0 2px; color: var(--accent-dark); }
.person-card .meaning { margin: 0 0 10px; color: var(--muted); font-size: 20px; }
.person-card .type-line { margin: 10px 0 4px; font-size: 22px; }
.person-card .type-line small { margin-left: 12px; color: var(--muted); letter-spacing: 0.1em; }
.person-card p { font-size: 20px; line-height: 1.7; }
.person-card .others { font-size: 17px; color: var(--muted); }
.pair-note { margin-top: 20px; padding: 20px 26px; border: 2px solid #ece4f5; border-radius: 22px; }
.pair-note .label { margin: 0; }
.pair-note h3 { font-size: 30px; margin: 2px 0 0; }
.line-box.wide { margin-top: 20px; }
@media (max-width: 760px) {
  .persons.two { grid-template-columns: 1fr; }
  .final .pair-stones { font-size: 30px; }
}

/* 完成イメージ（商品写真に石を重ねる） */
.ring-preview { margin: 18px 0 0; text-align: center; }
.ring-preview svg { width: 100%; max-width: 420px; height: auto; display: block; margin: 0 auto; border: 1px solid rgba(0,0,0,.12); }
.ring-preview [data-preview] { display: flex; gap: 12px; justify-content: center; }
.ring-preview-item { flex: 1 1 0; max-width: 420px; }
.ring-preview-caption { margin-top: 6px; font-size: 14px; line-height: 1.6; }
.ring-preview-note { margin: 4px 0 0; font-size: 12px; line-height: 1.6; opacity: .7; }
.pair-preview-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 0 0 10px; }
.pair-preview-chip { appearance: none; border: 1px solid rgba(0,0,0,.25); background: transparent; color: inherit; font: inherit; font-size: 15px; padding: 8px 18px; border-radius: 999px; cursor: pointer; }
.pair-preview-chip[aria-pressed="true"] { background: rgba(0,0,0,.82); color: #fff; border-color: transparent; }
