:root {
  --bg: #f7f6f3;
  --card-bg: #ffffff;
  --text: #17171a;
  --text-muted: #6b6b70;
  --border: #e6e4df;
  --ink: #17171a;
  --primary: #3d3a34;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

/* 헤더 — 그라데이션 없이 절제된 브랜드 톤 */
.site-header {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  padding: 36px 0 28px;
  text-align: center;
}

.quiz-header {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  border-top: 4px solid var(--accent, var(--primary));
}

.logo {
  color: var(--text);
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.tagline {
  margin: 10px 0 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.quiz-hero-badge {
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 16px auto 6px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent, var(--primary)) 14%, white);
  font-size: 1.7rem;
}

.site-header h1 {
  font-size: 1.35rem;
  margin: 6px 0 4px;
  letter-spacing: -0.01em;
}

.ad-slot { margin: 20px auto; }

.ad-placeholder {
  background: #fbfaf8;
  border: 1px dashed var(--border);
  color: var(--text-muted);
  text-align: center;
  padding: 18px;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 10px;
}

main { padding-bottom: 40px; }

/* 홈 - 퀴즈 그리드 */
.quiz-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.quiz-card {
  display: block;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px;
  text-decoration: none;
  color: var(--text);
  box-shadow: 0 1px 2px rgba(20, 18, 12, 0.03);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.quiz-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 22px rgba(20, 18, 12, 0.08);
  border-color: var(--accent);
}

.quiz-card-badge {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 14%, white);
  font-size: 1.3rem;
  margin-bottom: 12px;
}

.quiz-card h2 { font-size: 1.02rem; margin: 0 0 8px; letter-spacing: -0.01em; }

.quiz-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0 0 14px;
}

.quiz-card-cta {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent);
}

/* 카드 공통 */
.tool-card, .info-card, .result-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  margin-top: 20px;
  box-shadow: 0 1px 2px rgba(20, 18, 12, 0.03);
}

.tool-desc { color: var(--text-muted); font-size: 0.92rem; margin-bottom: 22px; }

.quiz-btn {
  display: inline-block;
  width: 100%;
  padding: 15px;
  background: var(--ink);
  color: white;
  border: none;
  border-radius: 11px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  box-sizing: border-box;
  transition: opacity 0.15s ease;
}

.quiz-btn:hover { opacity: 0.85; }

.quiz-btn-outline {
  background: white;
  color: var(--ink);
  border: 1.5px solid var(--border);
  margin-top: 8px;
}

.quiz-btn-outline:hover { border-color: var(--ink); opacity: 1; }

/* 퀴즈 진행 */
.quiz-progress {
  background: var(--border);
  border-radius: 999px;
  height: 6px;
  overflow: hidden;
  margin-bottom: 10px;
}

.quiz-progress-bar {
  background: var(--accent, var(--primary));
  height: 100%;
  width: 0%;
  transition: width 0.25s ease;
}

.quiz-question-count {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0 0 10px;
}

.quiz-app h2 { font-size: 1.1rem; margin: 0 0 18px; letter-spacing: -0.01em; }

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quiz-option-btn {
  padding: 15px 16px;
  border: 1.5px solid var(--border);
  background: white;
  border-radius: 11px;
  font-size: 0.95rem;
  text-align: left;
  cursor: pointer;
  color: var(--text);
  transition: border-color 0.15s, background 0.15s;
}

.quiz-option-btn:hover {
  border-color: var(--ink);
  background: #faf9f7;
}

/* 결과 카드 */
.result-card { text-align: center; }
.result-eyebrow {
  color: var(--text-muted);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0 0 10px;
}
.result-badge {
  width: 84px;
  height: 84px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 14%, white);
  font-size: 2.4rem;
}
.result-card h1 { font-size: 1.45rem; margin: 4px 0 14px; letter-spacing: -0.01em; color: var(--text); }
.result-desc { font-size: 0.96rem; color: var(--text); margin: 0 0 24px; text-align: left; }
.result-actions { display: flex; flex-direction: column; gap: 4px; }

.info-card h2 { font-size: 1.02rem; margin: 0 0 10px; }
.info-card p { font-size: 0.9rem; color: var(--text-muted); }
.info-card a { color: var(--ink); font-weight: 600; text-decoration: none; }

.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 0 40px;
  text-align: center;
}

.disclaimer {
  font-size: 0.76rem;
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto 16px;
}

.footer-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  margin: 0 10px;
}

.footer-nav a:hover { color: var(--ink); }

/* 홈 - 섹션 구분 (占い / タイプ診断) */
.content-section { margin-top: 8px; }
.content-section + .content-section { margin-top: 36px; }
.section-title {
  font-size: 1.05rem;
  margin: 0;
  letter-spacing: -0.01em;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

/* 입력 폼 (占いツール) */
.form-row { margin-bottom: 18px; }
.form-row label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.form-row input[type="text"],
.form-row select {
  width: 100%;
  padding: 13px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 0.96rem;
  font-family: inherit;
  color: var(--text);
  background: white;
  box-sizing: border-box;
}

.form-row input[type="text"]:focus,
.form-row select:focus {
  outline: none;
  border-color: var(--ink);
}

.form-select-group {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 8px;
}

.form-error {
  background: #fdf1f0;
  border: 1px solid #f0d0cd;
  color: #9c3b34;
  font-size: 0.85rem;
  padding: 12px 14px;
  border-radius: 10px;
  margin-bottom: 18px;
}

/* 血液型 상성 박스 */
.compat-box {
  background: #faf9f7;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  margin: 0 0 18px;
  text-align: left;
}
.compat-box .result-eyebrow { margin-bottom: 8px; }
.compat-box .result-desc { margin: 0; }

/* 姓名判断 결과 테이블 */
.seimei-table-wrap {
  overflow-x: auto;
  margin-bottom: 20px;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.seimei-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.seimei-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.seimei-table tr:last-child td { border-bottom: none; }

.seimei-label { font-weight: 700; white-space: nowrap; width: 20%; }
.seimei-value { font-weight: 700; white-space: nowrap; width: 12%; }
.seimei-judge { font-weight: 800; white-space: nowrap; width: 12%; }
.seimei-meaning { color: var(--text-muted); font-size: 0.8rem; }

.seimei-row-kichi .seimei-judge { color: #2c7a4b; }
.seimei-row-kyou .seimei-judge { color: #a04a3f; }

/* 제휴 안내 카드 (PR) */
.affiliate-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  margin-top: 16px;
  text-align: left;
}
.affiliate-eyebrow {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 8px;
  margin: 0 0 10px;
}
.affiliate-card h2 { font-size: 1rem; margin: 0 0 8px; }
.affiliate-card p { font-size: 0.88rem; color: var(--text-muted); margin: 0 0 16px; }
.affiliate-card .quiz-btn-outline { margin-top: 0; }

@media (max-width: 480px) {
  .tool-card, .info-card, .result-card, .affiliate-card { padding: 20px; }
  .site-header { padding: 28px 0 22px; }
  .form-select-group { grid-template-columns: 1fr; }
}

/* SEO内部リンクグリッド（フォーム画面の関連結果ページ一覧） */
.link-grid {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.link-grid-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  margin: 0 0 10px;
}
.link-grid-items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.link-grid-item {
  display: inline-block;
  font-size: 0.8rem;
  color: var(--text);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  text-decoration: none;
}
.link-grid-item:hover {
  border-color: var(--accent, var(--border));
}
