:root {
  --pink: #ff9ec7;
  --pink-deep: #ff6fab;
  --lavender: #c9b6ff;
  --mint: #aef0d6;
  --yellow: #ffe58a;
  --bg-1: #ffe9f4;
  --bg-2: #eee6ff;
  --text: #6b5b73;
  --text-soft: #9a8aa3;
  --card-radius: 28px;
  --shadow: 0 12px 32px rgba(180, 130, 200, 0.18);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", sans-serif;
  color: var(--text);
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% 20%, rgba(255, 255, 255, 0.8), transparent 35%),
    radial-gradient(circle at 85% 80%, rgba(255, 255, 255, 0.6), transparent 40%),
    linear-gradient(160deg, var(--bg-1), var(--bg-2));
  background-attachment: fixed;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(20px, 5vw, 40px) clamp(12px, 4vw, 24px) 48px;
}

.app {
  width: 100%;
  max-width: 480px;
}

/* スタート・結果画面は短いので上下に余白を持たせてセンタリング感を出す */
#screen-start .card,
#screen-result .card {
  margin-top: max(0px, calc(50vh - 440px));
}

/* 画面切り替え */
.screen {
  display: none;
}
.screen.active {
  display: block;
  animation: fade-up 0.45s ease both;
}
@keyframes fade-up {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.card {
  background: rgba(255, 255, 255, 0.88);
  border-radius: var(--card-radius);
  box-shadow: var(--shadow);
  padding: 36px 28px;
  text-align: center;
  border: 2px solid rgba(255, 255, 255, 0.9);
}

/* ---- スタート画面 ---- */
.kicker {
  margin: 0 0 6px;
  font-size: 13px;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--pink-deep);
}

.title {
  margin: 0 0 14px;
  font-size: 30px;
  font-weight: 800;
  color: var(--text);
}

.lead {
  margin: 0 0 22px;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-soft);
}

.hero-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 26px;
  font-size: 28px;
}
.hero-row span {
  display: inline-block;
  animation: float 3s ease-in-out infinite;
}
.hero-row span:nth-child(2) { animation-delay: 0.4s; }
.hero-row span:nth-child(3) { animation-delay: 0.8s; }
.hero-row span:nth-child(4) { animation-delay: 1.2s; }
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.note {
  margin: 16px 0 0;
  font-size: 12px;
  color: var(--text-soft);
}

/* ---- ボタン ---- */
.btn {
  display: inline-block;
  width: 100%;
  border: none;
  border-radius: 999px;
  padding: 16px 20px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}
.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: linear-gradient(135deg, var(--pink), var(--pink-deep));
  color: #fff;
  box-shadow: 0 10px 24px rgba(255, 111, 171, 0.45);
}
.btn-primary:hover {
  box-shadow: 0 14px 30px rgba(255, 111, 171, 0.55);
}

.btn-secondary {
  background: linear-gradient(135deg, var(--lavender), #a98cff);
  color: #fff;
  box-shadow: 0 10px 24px rgba(169, 140, 255, 0.4);
  margin-bottom: 12px;
}

.btn-ghost {
  background: transparent;
  color: var(--text-soft);
  border: 2px solid rgba(154, 138, 163, 0.3);
}
.btn-ghost:hover {
  background: rgba(154, 138, 163, 0.08);
}

/* ---- 質問画面(ページ式) ---- */
.page-card {
  padding: 24px 20px 28px;
}

.page-header {
  margin-bottom: 20px;
}
.page-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.page-badge {
  font-size: 13px;
  font-weight: 800;
  color: var(--pink-deep);
  letter-spacing: 0.04em;
}
.page-qrange {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-soft);
}
.progress-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 158, 199, 0.2);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--pink), var(--pink-deep));
  transition: width 0.45s ease;
}

/* 質問アイテム */
.q-item {
  border: 2px solid rgba(255, 158, 199, 0.28);
  border-radius: 20px;
  padding: 16px 16px 14px;
  margin-bottom: 14px;
  background: #fff;
  transition: border-color 0.2s ease;
}
.q-item.answered {
  border-color: rgba(255, 111, 171, 0.55);
  background: rgba(255, 249, 252, 0.9);
}

.q-num {
  margin: 0 0 5px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--pink-deep);
}
.q-text {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.6;
  color: var(--text);
}

.q-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.q-opt {
  width: 100%;
  min-height: 48px;
  text-align: left;
  border: 2px solid rgba(255, 158, 199, 0.35);
  background: #fff;
  border-radius: 14px;
  padding: 11px 14px;
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.q-opt::before {
  content: "♡ ";
  color: rgba(255, 158, 199, 0.6);
  transition: color 0.15s ease;
}
.q-opt:active {
  transform: scale(0.98);
}
.q-opt.selected {
  background: linear-gradient(135deg, #fff0f7, #ffe4f0);
  border-color: var(--pink-deep);
  color: var(--text);
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(255, 111, 171, 0.2);
}
.q-opt.selected::before {
  content: "♡ ";
  color: var(--pink-deep);
}

/* ナビゲーションボタン */
.page-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
}
.page-back {
  flex: 0 0 auto;
  width: auto;
  padding: 14px 20px;
  font-size: 14px;
}
.page-next {
  flex: 1;
  font-size: 15px;
  transition: opacity 0.2s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.page-next:disabled {
  opacity: 0.45;
  pointer-events: none;
}

/* ---- 結果画面 ---- */
.result-character {
  position: relative;
  width: 100%;
  max-width: 300px;
  margin: -8px auto 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.result-character::before {
  content: "";
  position: absolute;
  inset: 8% 12% 18%;
  background: radial-gradient(closest-side, rgba(255, 158, 199, 0.35), transparent 75%);
  filter: blur(6px);
  z-index: 0;
}
.result-character img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: auto;
  max-height: 320px;
  object-fit: contain;
  filter: drop-shadow(0 16px 22px rgba(180, 130, 200, 0.28));
  animation: char-float 3.6s ease-in-out infinite;
}
@keyframes char-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
.placeholder-img {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: linear-gradient(160deg, #fff, #ffeaf4);
  box-shadow: inset 0 0 0 6px rgba(255, 255, 255, 0.7);
  font-size: 13px;
  text-align: center;
  color: var(--text-soft);
  font-weight: 700;
  padding: 0 16px;
}

.result-code {
  margin: 0 0 4px;
  font-size: 13px;
  letter-spacing: 0.18em;
  font-weight: 800;
  color: var(--pink-deep);
}

.result-name {
  margin: 0 0 10px;
  font-size: 24px;
  font-weight: 800;
}

.result-catch {
  margin: 0 0 14px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-soft);
}

.result-desc {
  margin: 0 0 20px;
  font-size: 14px;
  line-height: 1.8;
  text-align: left;
  color: var(--text);
}

.result-tags {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 26px;
  flex-wrap: wrap;
}
.tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 7px 16px;
  border-radius: 999px;
  background: rgba(255, 158, 199, 0.18);
  color: var(--pink-deep);
}

/* ---- 相性セクション ---- */
.compat-section {
  margin-bottom: 28px;
  padding: 20px 0 4px;
  border-top: 2px dashed rgba(255, 158, 199, 0.35);
}
.compat-title {
  margin: 0 0 16px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--pink-deep);
  text-align: center;
}
.compat-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}
.compat-card {
  background: rgba(255, 255, 255, 0.7);
  border: 2px solid rgba(255, 158, 199, 0.3);
  border-radius: 20px;
  padding: 14px 12px 12px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.compat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(255, 158, 199, 0.25);
}
.compat-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 3px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--pink), var(--pink-deep));
  color: #fff;
  white-space: nowrap;
}
.compat-char {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 4px 0 2px;
}
.compat-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(180, 130, 200, 0.25));
}
.compat-name {
  margin: 0;
  font-size: 12px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.4;
}
.compat-code {
  margin: 0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--pink-deep);
}
.compat-reason {
  margin: 4px 0 0;
  font-size: 11px;
  line-height: 1.6;
  color: var(--text-soft);
  text-align: left;
}
.compat-hint {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--pink-deep);
  text-align: center;
}

.share-label {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-soft);
}

.share-row {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 22px;
}

.btn-share {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  flex: 1;
  border: none;
  border-radius: 999px;
  padding: 14px 16px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn-share:active {
  transform: scale(0.96);
}
.share-icon {
  font-size: 16px;
  line-height: 1;
}

.btn-share-twitter {
  background: linear-gradient(135deg, #4a4a4a, #1a1a1a);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.25);
}
.btn-share-instagram {
  background: linear-gradient(135deg, #ff9e6d, #ff5f9e, #c656d6);
  box-shadow: 0 10px 22px rgba(214, 86, 196, 0.35);
}

.result-actions {
  display: flex;
  flex-direction: column;
}

/* ---- 広告枠 ---- */
.ad-wrap {
  margin: 18px -4px 4px;
  min-height: 90px;
  overflow: hidden;
  border-radius: 12px;
}
.ad-unit {
  display: block;
}

@media (max-width: 380px) {
  .card { padding: 28px 20px; }
  .title { font-size: 26px; }
}
