:root {
  --bg: #14102a;
  --bg2: #221a44;
  --surface: rgba(255, 255, 255, 0.06);
  --surface-strong: rgba(255, 255, 255, 0.1);
  --line: rgba(255, 255, 255, 0.14);
  --text: #f4f0ff;
  --muted: #b9b0d6;
  --gold: #e8c87a;
  --gold-deep: #c9a24f;
  --pink: #f29ab8;
  --cta: #f0628f;
  --cta-deep: #d9446f;
  --radius: 16px;
  --mincho: "Shippori Mincho", "Hiragino Mincho ProN", serif;
  --sans: "Noto Sans JP", "Hiragino Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  color: var(--text);
  line-height: 1.75;
  background:
    radial-gradient(ellipse at 20% -10%, rgba(242, 154, 184, 0.18), transparent 55%),
    radial-gradient(ellipse at 90% 10%, rgba(232, 200, 122, 0.12), transparent 50%),
    linear-gradient(180deg, var(--bg2), var(--bg) 60%);
  background-attachment: fixed;
}

.wrap { width: 100%; max-width: 480px; margin: 0 auto; padding: 0 16px; }
.pr-bar {
  font-size: 11px; color: var(--muted); text-align: center;
  padding: 6px 16px; background: rgba(0, 0, 0, 0.25); letter-spacing: 0.04em;
}

/* ---------- 共通 ---------- */
.screen { padding: 28px 0 32px; animation: fade 0.45s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.eyebrow {
  display: inline-block; font-size: 12px; letter-spacing: 0.2em; color: var(--gold);
  border: 1px solid rgba(232, 200, 122, 0.5); border-radius: 999px; padding: 2px 12px;
}
h1, h2, h3 { font-family: var(--mincho); font-weight: 700; line-height: 1.45; margin: 0; }
h1 { font-size: 30px; margin: 16px 0 12px; }
h2 { font-size: 22px; }
h3 { font-size: 17px; }
.sub { color: var(--muted); font-size: 15px; margin: 0; }
.center { text-align: center; }

.btn {
  display: block; width: 100%; border: 0; cursor: pointer; text-decoration: none; text-align: center;
  font: 700 17px/1.4 var(--sans); color: #fff; padding: 18px 20px; border-radius: 999px;
  background: linear-gradient(180deg, var(--cta), var(--cta-deep));
  box-shadow: 0 8px 24px rgba(240, 98, 143, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transition: transform 0.12s ease;
}
.btn:active { transform: scale(0.98); }
.btn.pulse { animation: pulse 2.2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 8px 24px rgba(240, 98, 143, 0.35); } 50% { box-shadow: 0 8px 36px rgba(240, 98, 143, 0.7); } }
.btn[aria-disabled="true"] { opacity: 0.5; pointer-events: none; }
.btn small { display: block; font-weight: 500; font-size: 12px; opacity: 0.9; }
.btn-ghost {
  background: none; border: 0; color: var(--muted); font: 500 14px var(--sans);
  padding: 8px 0; cursor: pointer;
}

.badges { display: flex; justify-content: center; gap: 8px; margin: 20px 0 24px; flex-wrap: wrap; }
.badge { font-size: 12px; padding: 4px 12px; border-radius: 999px; background: var(--surface-strong); color: var(--text); }

/* ---------- イントロ ---------- */
.hero { text-align: center; padding-top: 12px; }
.hero-orb {
  width: 120px; height: 120px; margin: 8px auto 0; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff8e6, var(--gold) 35%, var(--gold-deep) 60%, transparent 72%);
  filter: drop-shadow(0 0 28px rgba(232, 200, 122, 0.6));
  animation: float 4s ease-in-out infinite;
}
@keyframes float { 50% { transform: translateY(-8px); } }
.empathy {
  margin: 24px 0; padding: 18px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); font-size: 14px; text-align: left;
}
.empathy ul { margin: 8px 0 0; padding-left: 1.2em; }
.empathy li { margin: 2px 0; }

/* ---------- テーマ選択 ---------- */
.theme-list { display: grid; gap: 12px; margin-top: 24px; }
.theme-btn {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  padding: 18px 20px; border-radius: var(--radius); cursor: pointer; text-align: left;
  background: var(--surface); border: 1px solid var(--line); color: var(--text);
  font: 700 17px var(--sans);
}
.theme-btn span { font-weight: 400; font-size: 13px; color: var(--muted); display: block; }
.theme-btn::after { content: "›"; font-size: 24px; color: var(--gold); }

/* ---------- 質問 ---------- */
.progress { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.progress-bar { flex: 1; height: 6px; border-radius: 6px; background: var(--surface-strong); overflow: hidden; }
.progress-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--pink), var(--gold)); transition: width 0.4s ease; }
.q-num { font-family: var(--mincho); color: var(--gold); font-size: 15px; margin: 28px 0 6px; }
.q-text { font-size: 22px; margin-bottom: 22px; }
.opts { display: grid; gap: 10px; }
.opt {
  width: 100%; padding: 16px 18px; border-radius: 14px; cursor: pointer; text-align: left;
  font: 500 16px/1.5 var(--sans); color: var(--text);
  background: var(--surface); border: 1px solid var(--line);
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.opt:hover { background: var(--surface-strong); }
.opt.selected { border-color: var(--gold); background: rgba(232, 200, 122, 0.16); transform: scale(0.99); }
.back-row { margin-top: 18px; text-align: center; }

/* ---------- カード選択 ---------- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 28px 0 8px; perspective: 800px; }
.tcard { aspect-ratio: 2 / 3; cursor: pointer; border: 0; padding: 0; background: none; }
.tcard-inner {
  position: relative; width: 100%; height: 100%; transform-style: preserve-3d;
  transition: transform 0.7s cubic-bezier(.2,.8,.2,1);
}
.tcard.flipped .tcard-inner { transform: rotateY(180deg); }
.tcard-face {
  position: absolute; inset: 0; border-radius: 12px; backface-visibility: hidden;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(232, 200, 122, 0.55);
}
.tcard-back {
  background:
    repeating-linear-gradient(45deg, rgba(232,200,122,.12) 0 2px, transparent 2px 10px),
    linear-gradient(160deg, #3a2a6e, #1a1238);
  font-size: 26px; color: var(--gold);
}
.tcard-front {
  transform: rotateY(180deg);
  background: linear-gradient(160deg, #fff6df, #e8c87a);
  color: #3a2a12; font-family: var(--mincho); font-size: 28px; font-weight: 700;
}
.tcard.dim { opacity: 0.35; transition: opacity 0.5s; }
.tcard:not(.flipped):hover .tcard-inner { transform: translateY(-4px); }
.card-msg { min-height: 64px; text-align: center; font-family: var(--mincho); font-size: 16px; color: var(--gold); }

/* ---------- ローディング ---------- */
.loading { text-align: center; padding-top: 80px; min-height: 60vh; }
.spinner {
  width: 72px; height: 72px; margin: 0 auto 28px; border-radius: 50%;
  border: 2px solid rgba(232, 200, 122, 0.2); border-top-color: var(--gold);
  animation: spin 1.1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-msg { font-family: var(--mincho); font-size: 17px; min-height: 2em; }

/* ---------- 結果 ---------- */
.result-head { text-align: center; }
.result-head .label { font-size: 13px; color: var(--muted); margin-top: 10px; }
.type-name {
  font-size: 32px; margin: 4px 0 14px;
  background: linear-gradient(90deg, var(--gold), #fff1c9, var(--gold));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.type-catch { font-family: var(--mincho); font-size: 18px; line-height: 1.6; }

.panel {
  margin-top: 20px; padding: 20px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line);
}
.panel h3 { margin-bottom: 10px; color: var(--gold); }
.panel p { margin: 0 0 10px; font-size: 15px; }
.panel p:last-child { margin-bottom: 0; }
.checks { list-style: none; margin: 0; padding: 0; }
.checks li { position: relative; padding-left: 26px; margin: 8px 0; font-size: 15px; }
.checks li::before { content: "✦"; position: absolute; left: 0; color: var(--gold); }

.meter-row { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; color: var(--muted); }
.meter-val { font-family: var(--mincho); font-size: 30px; color: var(--text); }
.meter { height: 10px; border-radius: 10px; background: var(--surface-strong); overflow: hidden; margin-top: 6px; }
.meter i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--pink), var(--gold)); transition: width 1.4s cubic-bezier(.2,.8,.2,1); }

.drawn { display: flex; gap: 14px; align-items: center; }
.drawn-card {
  flex: 0 0 56px; height: 84px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #fff6df, #e8c87a); color: #3a2a12; font: 700 22px var(--mincho);
}
.caution { border-color: rgba(242, 154, 184, 0.45); background: rgba(242, 154, 184, 0.08); }
.caution h3 { color: var(--pink); }

.lock-area { position: relative; min-height: 150px; border-radius: 10px; overflow: hidden; }
.lock-area .blur { filter: blur(5px); user-select: none; opacity: 0.7; }
.lock-area .lock-msg {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  padding: 20px; text-align: center; font-size: 14px; font-weight: 500;
  background: linear-gradient(180deg, rgba(20,16,42,.2), rgba(20,16,42,.85));
}

.section-title { text-align: center; margin: 36px 0 6px; }
.section-sub { text-align: center; color: var(--muted); font-size: 13px; margin: 0 0 16px; }
.solutions { display: grid; gap: 12px; }
.sol {
  padding: 16px 18px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line);
}
.sol-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.sol-title { font-weight: 700; font-size: 15px; }
.stars { color: var(--gold); letter-spacing: 1px; white-space: nowrap; font-size: 14px; }
.stars .off { color: rgba(255, 255, 255, 0.2); }
.sol p { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.sol.reco {
  position: relative; border: 2px solid var(--gold);
  background: linear-gradient(160deg, rgba(232, 200, 122, 0.18), rgba(240, 98, 143, 0.1));
  box-shadow: 0 0 24px rgba(232, 200, 122, 0.25);
}
.sol.reco p { color: var(--text); }
.reco-tag {
  position: absolute; top: -12px; left: 16px; font-size: 12px; font-weight: 700; color: #3a2a12;
  background: var(--gold); padding: 2px 12px; border-radius: 999px;
}

.cta-box { margin: 28px 0 8px; text-align: center; }
.cta-lead { font-family: var(--mincho); font-size: 17px; margin-bottom: 14px; }
.cta-bonus { font-size: 13px; color: var(--gold); margin: 10px 0 0; }
.cta-note { font-size: 11px; color: var(--muted); margin: 8px 0 0; }

.advisors { display: grid; gap: 12px; }
.advisor {
  display: block; text-decoration: none; color: var(--text);
  padding: 16px 18px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line);
}
.advisor-name { font-weight: 700; font-size: 16px; }
.advisor-spec { font-size: 12px; color: var(--gold); }
.advisor p { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.advisor-link { display: inline-block; margin-top: 8px; font-size: 13px; color: var(--pink); font-weight: 700; }

.retry { text-align: center; margin-top: 24px; }

/* ---------- フッター ---------- */
.footer { padding-top: 24px; padding-bottom: 40px; border-top: 1px solid var(--line); margin-top: 16px; }
.note { font-size: 11px; color: var(--muted); margin: 4px 0; }
.footer-nav { display: flex; gap: 16px; margin: 14px 0 6px; }
.footer-nav a { color: var(--muted); font-size: 12px; }
.copy { font-size: 11px; color: var(--muted); margin: 0; }

/* ---------- 下層ページ ---------- */
.doc { padding: 28px 0 32px; font-size: 14px; }
.doc h1 { font-size: 24px; }
.doc h2 { font-size: 17px; margin: 24px 0 8px; color: var(--gold); }
.doc table { width: 100%; border-collapse: collapse; }
.doc th, .doc td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.doc th { width: 32%; color: var(--muted); font-weight: 500; }
.doc a { color: var(--pink); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
