/* ============================
   DESIGN TOKENS — 古地図RPGテーマ
   ============================ */
:root {
  /* 羊皮紙・古地図カラー */
  --bg: #f2e8d5;
  --bg2: #ede0c4;
  --bg3: #e7d8b8;
  --card: #faf4e6;
  --card-border: #c9a97a;
  --text: #2e1f0e;
  --text-sub: #6b4c2a;
  --text-muted: #a07d52;

  /* アクセントカラー */
  --gold: #b07d2c;
  --gold-light: #e4b84a;
  --gold-dim: rgba(176, 125, 44, 0.15);
  --green: #3a6b3a;
  --green-dim: rgba(58, 107, 58, 0.15);
  --red: #8b2020;
  --red-dim: rgba(139, 32, 32, 0.12);
  --purple: #5c3d7a;
  --purple-dim: rgba(92, 61, 122, 0.12);
  --ink: #1a0f02;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 6px 28px rgba(80, 40, 10, 0.18);
  --shadow-sm: 0 2px 10px rgba(80, 40, 10, 0.12);
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Noto Sans JP', sans-serif;
  background-color: var(--bg);
  /* 羊皮紙のグレイン感をCSSノイズで表現 */
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.06'/%3E%3C/svg%3E");
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.7;
}

/* ============================
   SCREENS
   ============================ */
.screen {
  display: none;
  min-height: 100vh;
  animation: fadeIn 0.4s ease;
}

.screen.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.container {
  max-width: 520px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ============================
   背景装飾（古地図模様）
   ============================ */
.bg-orbs {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.25;
}

.orb-1 {
  width: 420px;
  height: 420px;
  background: #c8943a;
  top: -100px;
  left: -120px;
}

.orb-2 {
  width: 360px;
  height: 360px;
  background: #6b9b6b;
  bottom: -100px;
  right: -100px;
}

.orb-3 {
  width: 280px;
  height: 280px;
  background: #d4a017;
  top: 45%;
  left: 55%;
}

/* ============================
   古地図風の枠線ユーティリティ
   ============================ */
.parchment-border {
  border: 2px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm), inset 0 0 20px rgba(176, 125, 44, 0.06);
}

/* ============================
   START SCREEN
   ============================ */
#screen-start {
  position: relative;
}

.start-container {
  position: relative;
  z-index: 1;
  padding-top: 28px;
  padding-bottom: 80px;
  text-align: center;
}

.hero-banner-img {
  width: 100%;
  border-radius: var(--radius);
  display: block;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

.logo-badge {
  display: inline-block;
  background: var(--gold-dim);
  border: 1.5px solid var(--gold);
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  padding: 6px 18px;
  border-radius: 100px;
  margin-bottom: 28px;
}

/* タイトルを古地図っぽいセリフ風に */
.start-title {
  font-size: clamp(26px, 7vw, 40px);
  font-weight: 900;
  line-height: 1.3;
  margin-bottom: 18px;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.highlight {
  background: linear-gradient(135deg, var(--gold), #d97b20);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.start-sub {
  font-size: 15px;
  color: var(--text-sub);
  margin-bottom: 32px;
  line-height: 1.85;
}

/* チェックリスト */
.checklist {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
  background: var(--card);
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin-bottom: 32px;
  box-shadow: var(--shadow-sm);
  position: relative;
}

/* 羊皮紙コーナー装飾 */
.checklist::before,
.checklist::after {
  content: '✦';
  position: absolute;
  color: var(--gold);
  font-size: 10px;
  opacity: 0.5;
}

.checklist::before {
  top: 6px;
  left: 10px;
}

.checklist::after {
  bottom: 6px;
  right: 10px;
}

.check-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text-sub);
}

.check-icon {
  color: var(--green);
  font-size: 12px;
  flex-shrink: 0;
}

.choose-label {
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.15em;
  margin-bottom: 18px;
  text-transform: uppercase;
}

/* ============================
   MODE CARDS（古地図の巻物風）
   ============================ */
.mode-cards {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

.mode-card {
  background: var(--card);
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: left;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

/* 左側のアクセントライン（巻物のヒモ風） */
.mode-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  border-radius: 4px 0 0 4px;
  transition: opacity 0.3s;
}

#btn-business::before {
  background: linear-gradient(to bottom, var(--gold-light), var(--gold));
}

#btn-personality::before {
  background: linear-gradient(to bottom, #68b068, var(--green));
}

.mode-card:hover {
  transform: translateY(-3px);
  border-color: var(--gold);
  box-shadow: var(--shadow);
}

.mode-icon {
  font-size: 30px;
  margin-bottom: 10px;
}

.mode-badge {
  font-size: 11px;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

#btn-business .mode-badge {
  color: var(--gold);
}

#btn-personality .mode-badge {
  color: var(--green);
}

.mode-title {
  font-size: 19px;
  font-weight: 900;
  margin-bottom: 8px;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.mode-desc {
  font-size: 13px;
  color: var(--text-sub);
  line-height: 1.75;
  margin-bottom: 12px;
}

.mode-time {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.mode-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  padding: 10px 22px;
  border-radius: 100px;
  transition: var(--transition);
  border: none;
}

#btn-business .mode-cta {
  background: var(--gold);
  color: #fff;
}

#btn-personality .mode-cta {
  background: var(--green);
  color: #fff;
}

.mode-card:hover .mode-cta {
  transform: translateX(4px);
}

.start-footer {
  font-size: 12px;
  color: var(--text-muted);
}

/* ============================
   QUIZ SCREEN
   ============================ */
.quiz-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1.5px solid var(--card-border);
  background: var(--bg2);
  position: sticky;
  top: 0;
  z-index: 10;
}

.back-btn {
  background: var(--card);
  border: 1.5px solid var(--card-border);
  color: var(--text-sub);
  font-size: 13px;
  padding: 7px 14px;
  border-radius: 100px;
  cursor: pointer;
  transition: var(--transition);
  font-family: 'Noto Sans JP', sans-serif;
}

.back-btn:hover {
  background: var(--bg3);
  border-color: var(--gold);
  color: var(--ink);
}

.quiz-title-small {
  font-size: 13px;
  color: var(--text-muted);
}

.progress-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: var(--bg2);
  border-bottom: 1px solid var(--card-border);
}

.progress-bar {
  flex: 1;
  height: 8px;
  background: var(--bg3);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--card-border);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-light), var(--gold));
  border-radius: 4px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  width: 0%;
}

.progress-text {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  font-weight: 700;
}

.quiz-container {
  padding-top: 36px;
  padding-bottom: 60px;
}

.question-text {
  font-size: clamp(17px, 5vw, 21px);
  font-weight: 700;
  line-height: 1.55;
  margin-bottom: 30px;
  color: var(--ink);
}

.choices-wrap {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.choice-btn {
  background: var(--card);
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  text-align: left;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text);
  font-size: 15px;
  font-family: 'Noto Sans JP', sans-serif;
  line-height: 1.5;
  box-shadow: var(--shadow-sm);
}

.choice-btn:hover {
  border-color: var(--gold);
  background: var(--gold-dim);
  transform: translateX(5px);
  box-shadow: var(--shadow);
}

.choice-btn.selected {
  border-color: var(--gold);
  background: var(--gold-dim);
  font-weight: 700;
}

/* ============================
   LOADING SCREEN
   ============================ */
#screen-loading {
  align-items: center;
  justify-content: center;
}

#screen-loading.active {
  display: flex;
  background: var(--bg);
}

.loading-container {
  text-align: center;
  position: relative;
  z-index: 1;
}

.loading-icon {
  font-size: 64px;
  margin-bottom: 24px;
  animation: pulse 1.8s infinite;
}

@keyframes pulse {

  0%,
  100% {
    transform: scale(1) rotate(0deg);
  }

  50% {
    transform: scale(1.07) rotate(3deg);
  }
}

.loading-title {
  font-size: 22px;
  font-weight: 900;
  margin-bottom: 28px;
  color: var(--ink);
}

.loading-bar-wrap {
  width: 240px;
  margin: 0 auto 20px;
}

.loading-bar {
  height: 10px;
  background: var(--bg3);
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid var(--card-border);
}

.loading-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-light), var(--gold));
  border-radius: 5px;
  width: 0%;
}

.loading-msg {
  font-size: 13px;
  color: var(--text-muted);
  min-height: 20px;
}

/* ============================
   RESULT SCREEN
   ============================ */
.result-header {
  padding: 14px 20px;
  border-bottom: 1.5px solid var(--card-border);
  background: var(--bg2);
}

.result-container {
  padding-top: 24px;
  padding-bottom: 80px;
}

/* Result Hero — 羊皮紙の証書風 */
.result-hero {
  text-align: center;
  padding: 32px 24px;
  background: var(--card);
  border: 2px solid var(--card-border);
  border-radius: var(--radius);
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
}

/* 四隅の装飾 */
.result-hero::before,
.result-hero::after {
  content: '✦';
  position: absolute;
  font-size: 14px;
  color: var(--gold);
  opacity: 0.5;
}

.result-hero::before {
  top: 10px;
  left: 14px;
}

.result-hero::after {
  bottom: 10px;
  right: 14px;
}

.result-label {
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 10px;
}

.result-type-icon {
  font-size: 52px;
  margin-bottom: 12px;
}

.result-type-name {
  font-size: clamp(22px, 6vw, 30px);
  font-weight: 900;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.result-type-name.gold {
  color: var(--gold);
}

.result-type-name.green {
  color: var(--green);
}

.result-type-sub {
  font-size: 14px;
  color: var(--text-sub);
  line-height: 1.7;
}

/* フック */
.result-hook {
  background: #fef9ee;
  border: 1.5px solid var(--gold);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin-bottom: 18px;
  font-size: 15px;
  line-height: 1.85;
  color: var(--text-sub);
  box-shadow: var(--shadow-sm);
}

.result-hook strong {
  color: var(--ink);
}

/* セクションカード */
.result-section {
  background: var(--card);
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}

.section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 14px;
}

/* 弱点カード */
.alert-card {
  background: #fff8f8;
  border: 1.5px solid rgba(139, 32, 32, 0.3);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin-bottom: 14px;
}

.alert-card .card-label {
  color: var(--red);
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 8px;
}

/* 攻略カード */
.success-card {
  background: #f4faf4;
  border: 1.5px solid rgba(58, 107, 58, 0.35);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin-bottom: 14px;
}

.success-card .card-label {
  color: var(--green);
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 8px;
}

/* リスト */
.bullet-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bullet-list li {
  font-size: 14px;
  color: var(--text-sub);
  padding-left: 18px;
  position: relative;
  line-height: 1.65;
}

.bullet-list li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--text-muted);
}

.check-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.check-list li {
  font-size: 14px;
  color: var(--text-sub);
  padding-left: 22px;
  position: relative;
  line-height: 1.65;
}

.check-list li::before {
  content: '✔';
  position: absolute;
  left: 0;
  color: var(--green);
  font-size: 12px;
}

/* RPG商店セクション */
.shop-section {
  border-color: var(--gold) !important;
  background: #fef9ee !important;
  margin-top: 32px !important;
  padding: 16px !important;
}

.shop-banner {
  margin-bottom: 14px;
}

.shop-banner-img {
  width: 100%;
  border-radius: var(--radius-sm);
  display: block;
  margin-bottom: 10px;
}

.shop-sub-below {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.5;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--card-border);
}

/* サービスカード */
.service-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.service-item {
  background: var(--bg2);
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 13px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: var(--transition);
  text-decoration: none;
  color: var(--text);
  cursor: pointer;
}

.service-item:hover {
  border-color: var(--gold);
  background: var(--gold-dim);
}

.service-item:hover .service-arrow {
  transform: translateX(4px);
}

.service-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.service-info {
  flex: 1;
}

.service-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 2px;
}

.service-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

.service-arrow {
  font-size: 14px;
  color: var(--gold);
  flex-shrink: 0;
  transition: var(--transition);
}

/* CTA */
.cta-section {
  margin-top: 28px;
}

.cta-label {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 14px;
  letter-spacing: 0.1em;
}

.cta-primary {
  display: block;
  width: 100%;
  background: var(--gold);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  padding: 17px 24px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  text-align: center;
  transition: var(--transition);
  font-family: 'Noto Sans JP', sans-serif;
  text-decoration: none;
  margin-bottom: 10px;
  box-shadow: 0 4px 16px rgba(176, 125, 44, 0.35);
  letter-spacing: 0.02em;
}

.cta-primary:hover {
  background: var(--gold-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(176, 125, 44, 0.45);
}

.cta-secondary {
  display: block;
  width: 100%;
  background: var(--card);
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  padding: 15px 24px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--card-border);
  cursor: pointer;
  text-align: center;
  transition: var(--transition);
  font-family: 'Noto Sans JP', sans-serif;
  text-decoration: none;
}

.cta-secondary:hover {
  border-color: var(--gold);
  background: var(--gold-dim);
  color: var(--ink);
}

/* 個別相談ボタン専用の余白設定 */
.cta-spacer {
  display: block;    /* 確実に1行占有させる */
  clear: both;       /* 周りからの回り込みを解除 */
  margin-top: 40px;  /* 50pxだと開きすぎかもしれないので、まずは40pxくらいで */
  padding-top: 10px; /* 余白をより確実にするためにpaddingも追加 */
  width: 100%;
}

/* cta-spacerの中にあるボタン自体の余白もリセット */
.cta-spacer .cta-secondary {
  margin-top: 0;
}

/* service-gridの直後にあるcta-spacerに強制的に余白をつける */
.service-grid + .cta-spacer {
  margin-top: 40px !important; /* !importantで強制適用 */
}

/* サブタイプバッジ */
.sub-type-badge {
  display: inline-block;
  background: var(--purple-dim);
  border: 1px solid rgba(92, 61, 122, 0.4);
  color: var(--purple);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: 100px;
  margin-top: 12px;
}

/* リスクコールアウト */
.risk-callout {
  background: rgba(139, 32, 32, 0.05);
  border-left: 3px solid var(--red);
  padding: 12px 16px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 14px;
  color: var(--text-sub);
  line-height: 1.7;
  margin-top: 12px;
}

.risk-callout strong {
  color: var(--red);
}

/* ============================
   スクロールバー
   ============================ */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--card-border);
  border-radius: 3px;
}

/* ============================
   FOOTER
   ============================ */
.site-footer {
  text-align: center;
  padding: 20px;
  border-top: 1px solid var(--card-border);
  background: var(--bg2);
}

.footer-link {
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 0.05em;
  transition: var(--transition);
}

.footer-link:hover {
  color: var(--gold);
}