/* ===== ベース ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #0b1533;
  --card: #101d42;
  --panel: #16244c;
  --text: #eef1f8;
  --sub: #9aa6c4;
  --gold: #d4a547;
  --gold-dark: #b8893a;
  --border: #26355f;
  --radius: 16px;
}

body {
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic UI",
    "Meiryo", sans-serif;
  background: linear-gradient(160deg, #0a1230 0%, #0e1a3e 50%, #1a2450 100%);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.7;
}

.container {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  padding: 24px 16px;
  flex: 1;
}

/* ===== カード / 画面切り替え ===== */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  padding: 32px 24px;
}

.screen {
  display: none;
}

.screen.active {
  display: block;
  animation: fadeIn 0.35s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== スタート画面 ===== */
.eyebrow {
  text-align: center;
  font-size: 13px;
  color: var(--gold);
  font-weight: bold;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.title {
  text-align: center;
  font-size: 32px;
  margin-bottom: 16px;
}

.lead {
  text-align: center;
  color: var(--sub);
  margin-bottom: 20px;
}

.lead strong {
  color: var(--gold);
}

.type-preview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 28px;
}

.type-preview span {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 8px;
  text-align: center;
  font-size: 14px;
  font-weight: bold;
}

/* ===== ボタン ===== */
.btn {
  display: block;
  width: 100%;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: bold;
  font-family: inherit;
  cursor: pointer;
  padding: 16px;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease,
    border-color 0.12s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #0b1533;
  box-shadow: 0 4px 18px rgba(212, 165, 71, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #e0b45c, var(--gold));
}

.btn-option {
  background: var(--panel);
  color: var(--text);
  border: 2px solid var(--border);
  text-align: left;
  margin-bottom: 12px;
  line-height: 1.5;
}

.btn-option:hover {
  border-color: var(--gold);
  background: #1b2c5a;
}

.btn-ghost {
  background: transparent;
  color: var(--sub);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  background: var(--panel);
}

.btn-share {
  background: #000;
  color: #fff;
  border: 1px solid var(--border);
  text-align: center;
  text-decoration: none;
  margin-bottom: 12px;
  box-sizing: border-box;
}

.btn-share:hover {
  background: #1a1a1a;
}

.btn-back {
  background: none;
  border: none;
  color: var(--sub);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  margin-top: 8px;
  padding: 8px;
}

.btn-back:hover {
  color: var(--text);
}

/* ===== 質問画面 ===== */
.progress-wrap {
  margin-bottom: 24px;
}

.progress-bar {
  height: 8px;
  background: var(--panel);
  border-radius: 99px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold));
  border-radius: 99px;
  transition: width 0.3s ease;
}

.progress-text {
  text-align: right;
  font-size: 13px;
  color: var(--sub);
  margin-top: 6px;
}

.question-text {
  font-size: 20px;
  margin-bottom: 24px;
  min-height: 3em;
}

/* ===== 結果画面 ===== */
.result-emoji {
  text-align: center;
  font-size: 64px;
  line-height: 1.2;
}

.result-name {
  text-align: center;
  font-size: 28px;
  margin: 8px 0 4px;
  color: var(--gold);
}

.result-catch {
  text-align: center;
  color: var(--sub);
  margin-bottom: 24px;
}

.meters {
  margin-bottom: 24px;
}

.meter {
  margin-bottom: 14px;
}

.meter-labels {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--sub);
  margin-bottom: 4px;
}

.meter-labels span {
  transition: color 0.3s ease, opacity 0.3s ease;
}

.meter-labels .label-dominant {
  color: var(--gold);
  font-weight: bold;
}

.meter-labels .label-weak {
  opacity: 0.55;
}

.meter-bar {
  position: relative;
  height: 10px;
  background: var(--panel);
  border-radius: 99px;
  overflow: hidden;
}

/* 中央＝ニュートラルを示すセンターライン */
.meter-center {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
  background: rgba(238, 241, 248, 0.45);
}

/* 中央から寄っている側へ伸びる発散型バー */
.meter-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 0;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold));
  transition: width 0.8s ease;
}

.meter-fill.lean-right {
  left: 50%;
  border-radius: 0 99px 99px 0;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold));
}

.meter-fill.lean-left {
  right: 50%;
  border-radius: 99px 0 0 99px;
  background: linear-gradient(270deg, var(--gold-dark), var(--gold));
}

.result-section {
  margin-bottom: 20px;
  padding: 16px;
  background: var(--panel);
  border-radius: 12px;
}

.result-section.highlight {
  background: rgba(212, 165, 71, 0.1);
  border: 2px solid var(--gold);
}

.result-section h3 {
  font-size: 16px;
  margin-bottom: 8px;
}

.result-section ul {
  padding-left: 20px;
}

.result-section li {
  font-size: 14px;
  margin-bottom: 6px;
}

/* ===== シェアセクション ===== */
.share-section {
  text-align: center;
}

.share-guide {
  font-size: 14px;
  color: var(--sub);
  margin-bottom: 14px;
  line-height: 1.6;
}

.share-guide strong {
  color: var(--gold);
}

.share-steps {
  display: inline-block;
  margin-top: 4px;
  color: var(--text);
  font-weight: bold;
}

.share-canvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--border);
  margin-bottom: 14px;
}

.btn-save {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #0b1533;
  box-shadow: 0 4px 18px rgba(212, 165, 71, 0.35);
}

.btn-save:hover {
  background: linear-gradient(135deg, #e0b45c, var(--gold));
}

.result-actions {
  margin-top: 24px;
}

/* ===== フッター ===== */
.footer {
  text-align: center;
  padding: 20px 16px 28px;
  font-size: 12px;
  color: var(--sub);
}

.footer a {
  color: var(--gold);
  font-weight: bold;
}

/* ===== スマホ最適化 ===== */
@media (max-width: 420px) {
  .card {
    padding: 24px 18px;
  }

  .title {
    font-size: 26px;
  }

  .question-text {
    font-size: 18px;
  }
}
