/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

.form-group {
  margin-bottom: 1.25rem;
}

#result-table {
  margin-top: 1rem;
  font-size: 0.95rem;
}

#result-table th,
#result-table td {
  text-align: center;
  vertical-align: middle;
}

#result-table td.gogyo-top {
  font-size: smaller;
  border-bottom: none;
  padding-bottom: 0;
  vertical-align: bottom;
}

#result-table td.gogyo-bottom {
  font-size: smaller;
  border-top: none;
  padding-top: 0;
}

#result-table td[class^="kanshi"] {
  border-top: none;
  border-bottom: none;
}

/* --- 診断トップページ (root) --- */

body {
  background: linear-gradient(90deg, #f5eafb 0%, #ffffff 24%, #e9f7fa 50%, #fdfefd 76%, #d8f8d9 100%);
  background-attachment: fixed;
  min-height: 100vh;
}

.site-header {
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.site-header__inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.site-header__logo {
  font-family: "Shippori Mincho", serif;
  font-size: 1.05rem;
  letter-spacing: 0.05em;
  color: #222;
}

.btn-makuake {
  display: inline-block;
  background: #1a1a1a;
  color: #fff;
  border-radius: 6px;
  padding: 0.6rem 1.5rem;
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.btn-makuake:hover {
  background: #333;
  color: #fff;
}

.hero {
  max-width: 720px;
  margin: 3.5rem auto 2rem;
  padding: 0 1.5rem;
  text-align: center;
}

.hero__lead {
  font-family: "Shippori Mincho", serif;
  font-size: 1.1rem;
  letter-spacing: 0.15em;
  color: #3a3a3a;
  margin-bottom: 0.75rem;
}

.hero__title {
  font-family: "Shippori Mincho", serif;
  font-weight: 600;
  font-size: clamp(1.5rem, 4vw, 2.1rem);
  letter-spacing: 0.06em;
  color: #1f1f2e;
  margin-bottom: 1.5rem;
}

.hero__desc {
  color: #6b6b6b;
  font-size: 0.95rem;
  line-height: 1.9;
  margin-bottom: 0;
}

/* 文節単位でinline-blockにすることで、狭い画面でも文節の途中ではなく
   その境界で折り返させる (日本語の改行位置が不自然になるのを防ぐ) */
.hero__title span,
.hero__desc span,
.result-hero__title span,
.result-footer-note span {
  display: inline-block;
}

.diagnosis-card {
  max-width: 560px;
  margin: 0 auto 4rem;
  padding: 0 1.5rem;
}

.diagnosis-form .form-group {
  margin-bottom: 1.5rem;
}

.diagnosis-form label {
  display: block;
  font-size: 0.85rem;
  color: #555;
  margin-bottom: 0.5rem;
}

.diagnosis-form .input {
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 0.55rem 0.9rem;
  font-size: 0.9rem;
  color: #333;
  background-color: #fff;
}

.diagnosis-form .input-text {
  width: 100%;
}

.diagnosis-form select.input {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  background-size: 11px;
  padding-left: 0.6rem;
  padding-right: 1.5rem;
  cursor: pointer;
}

.diagnosis-form .select-year {
  min-width: 4.4rem;
}

.diagnosis-form .select-short {
  min-width: 2.9rem;
}

.diagnosis-form .select-gender {
  min-width: 10rem;
}

.diagnosis-form .form-row {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 1.5rem;
}

.diagnosis-form .form-col {
  min-width: 0;
}

@media (max-width: 576px) {
  .diagnosis-form .form-row {
    grid-template-columns: 1fr;
  }
}

.diagnosis-form .select-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.2rem;
}

.diagnosis-form .unit,
.diagnosis-form .colon {
  color: #555;
  font-size: 0.85rem;
  margin-right: 0.3rem;
}

.diagnosis-form .unknown-time {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: 0.75rem;
  white-space: nowrap;
}

.diagnosis-form .unknown-time label {
  margin-bottom: 0;
  font-size: 0.85rem;
  color: #555;
}

.submit-row {
  text-align: center;
  margin-top: 2rem;
}

.btn-diagnose {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: linear-gradient(135deg, #f0b74a, #d98a2b);
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 0.85rem 2.75rem;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  box-shadow: 0 8px 20px rgba(217, 138, 43, 0.35);
  cursor: pointer;
}

.btn-diagnose:hover {
  background: linear-gradient(135deg, #eaa93a, #c67c22);
}

@media (max-width: 576px) {
  .diagnosis-card {
    padding: 0 1.25rem;
  }
}

/* --- 鑑定結果ページ (result) --- */

.result-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}

.result-hero {
  text-align: center;
  margin-bottom: 2rem;
}

.result-hero__divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  color: #a89a7d;
  font-family: "Shippori Mincho", serif;
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  margin-bottom: 0.75rem;
}

.result-hero__divider-text {
  flex-shrink: 0;
  white-space: nowrap;
}

.result-hero__divider-img {
  width: 9rem;
  height: auto;
  flex-shrink: 1;
  min-width: 0;
}

.result-hero__title {
  font-family: "Shippori Mincho", serif;
  font-weight: 600;
  font-size: clamp(1.4rem, 4vw, 1.9rem);
  letter-spacing: 0.06em;
  color: #1f1f2e;
}

.result-sheet {
  background: #fff;
  padding: 2.5rem 2rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 2.25rem;
}

.result-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.section-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #fff5d0;
  color: #4a3f22;
  border-radius: 10px;
  padding: 0.75rem 1.1rem;
  font-family: "Shippori Mincho", serif;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  margin: 0;
}

.section-bar::before {
  content: "";
  width: 1.15em;
  height: 1.15em;
  flex: 0 0 auto;
  background-image: url("/assets/icon-6007dc74.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.type-summary {
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.type-summary-item {
  flex: 1 1 18rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
}

.type-summary .basic {
  padding-top: 0.5rem;
  font-family: "Shippori Mincho", serif;
  font-size: 1.3rem;
}

.gogyo-tag {
  text-align: center;
  background: #faf8f1;
  color: #6b5f45;
  font-size: 0.8rem;
  border: 1px solid #e5dfc9;
  border-radius: 999px;
  padding: 0.35rem 1.1rem;
  margin: 0 auto;
}

.gogyo-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.gogyo-circle {
  flex: 0 0 auto;
  width: 5.5rem;
  height: 5.5rem;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.gogyo-circle__kanji {
  font-family: "Shippori Mincho", serif;
  font-size: 1.4rem;
  line-height: 1.1;
}

.gogyo-circle__yomi {
  font-size: 0.65rem;
}

.gogyo-circle--moku { background: linear-gradient(135deg, #4fb87a, #2f9c5e); }
.gogyo-circle--ka   { background: linear-gradient(135deg, #f0806a, #d9553c); }
.gogyo-circle--do    { background: linear-gradient(135deg, #cf9a5c, #b17a3a); }
.gogyo-circle--gon  { background: linear-gradient(135deg, #b3b9c2, #8a919d); }
.gogyo-circle--sui  { background: linear-gradient(135deg, #5c9bd9, #3d76b3); }

/* 「◯の性質」の文字色を五行に合わせる (.gogyo-label__titleの色指定より優先させる) */
.gogyo-label__title.gogyo-text--moku { color: #2f9c5e; }
.gogyo-label__title.gogyo-text--ka   { color: #d9553c; }
.gogyo-label__title.gogyo-text--do   { color: #b17a3a; }
.gogyo-label__title.gogyo-text--gon  { color: #8a919d; }
.gogyo-label__title.gogyo-text--sui  { color: #3d76b3; }

.gogyo-label {
  text-align: center;
}

.gogyo-label__title {
  font-family: "Shippori Mincho", serif;
  font-size: 1.3rem;
  color: #1f1f2e;
  margin: 0;
}

.gogyo-label__sub {
  color: #8a8a8a;
  font-size: 0.85rem;
  margin: 0.25rem 0 0;
}

.type-name {
  text-align: center;
  font-family: "Shippori Mincho", serif;
  font-size: 1.05rem;
  color: #4a4a4a;
  margin: 0;
}

.type-name strong {
  font-size: 1.35rem;
  font-weight: 600;
}

.type-message {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.type-message p {
  color: #4a4a4a;
  font-size: 0.9rem;
  line-height: 2;
  margin: 0;
}

.table-wrap {
  background: #fff;
  border: 1px solid #ece8db;
  border-radius: 14px;
  overflow-x: auto;
}

/* 開運カラー・金運カラーで共用するテーブル */
.color-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.color-table th {
  background: #f3efe4;
  color: #4a3f22;
  font-weight: 600;
  padding: 0.75rem;
  text-align: left;
  white-space: nowrap;
}

.color-table th:first-child,
.color-table td:first-child {
  width: 9rem;
}

.color-table td {
  padding: 0.9rem 0.75rem;
  border-top: 1px solid #eee;
  vertical-align: top;
  color: #4a4a4a;
}

.color-table__name {
  white-space: nowrap;
  font-weight: 600;
  color: #1f1f2e;
}

.meishiki-date {
  text-align: center;
  color: #4a4a4a;
  font-size: 0.9rem;
  font-weight: 700;
  margin: -0.5rem 0 0.5rem;
}

#result-table {
  width: 100%;
  background: #fff;
  margin: 0;
}

#result-table th {
  background: #f3efe4;
  color: #4a3f22;
}

.keyword-list {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.keyword-item {
  flex: 1 1 160px;
  background: #fbf9f3;
  border: 1px solid #f0ecdd;
  border-radius: 12px;
  padding: 1rem 1.1rem;
}

.keyword-item__word {
  font-family: "Shippori Mincho", serif;
  font-weight: 600;
  font-size: 1.05rem;
  color: #1f1f2e;
  margin: 0 0 0.35rem;
}

.keyword-item__meaning {
  font-size: 0.85rem;
  color: #6b6b6b;
  line-height: 1.7;
  margin: 0;
}

.result-value {
  text-align: center;
  font-family: "Shippori Mincho", serif;
  font-size: 1.3rem;
  color: #1f1f2e;
  margin: 0;
}

.result-value--muted {
  font-family: inherit;
  font-size: 0.85rem;
  color: #8a8a8a;
}

.counselor-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: #f5f4f0;
  padding: 1.5rem;
}

.counselor-card__photo {
  flex: 0 0 auto;
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 50%;
  object-fit: cover;
}

.counselor-card__photo--placeholder {
  background: #e3ddc9;
}

.counselor-card__en {
  font-size: 0.75rem;
  color: #a89a7d;
  margin: 0;
  letter-spacing: 0.05em;
}

.counselor-card__name {
  font-family: "Shippori Mincho", serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: #1f1f2e;
  margin: 0.15rem 0 0.35rem;
}

.counselor-card__links {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 0.6rem;
}

.counselor-card__link {
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

.counselor-card__bio {
  font-size: 0.82rem;
  line-height: 1.8;
  color: #6b6b6b;
  margin: 0;
}

.wallets-image {
  display: block;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  border-radius: 14px;
}

.result-footer-note {
  text-align: center;
  font-family: "Shippori Mincho", serif;
  color: #4a4a4a;
  line-height: 2;
  font-size: 0.9rem;
}

.result-again-link {
  margin-top: 1rem;
}

.result-again-link a {
  color: #8a8a8a;
  font-size: 0.85rem;
  text-decoration: underline;
}

@media (max-width: 576px) {
  .result-page {
    padding: 2rem 0.75rem 3rem;
  }

  .result-sheet {
    padding: 1.75rem 1rem 2.25rem;
    border-radius: 16px;
  }

  .counselor-card {
    flex-direction: column;
    text-align: center;
  }

  .counselor-card__links {
    justify-content: center;
  }

  /* 見出しの文言は横に長く、狭い画面では列幅を押し広げて表がはみ出す。
     色名と説明だけで内容は読み取れるため見出し行ごと省く */
  .color-table__head {
    display: none;
  }

  .color-table th:first-child,
  .color-table td:first-child {
    width: 5rem;
  }

  .color-table td {
    padding: 0.75rem 0.6rem;
  }

  .color-table__name {
    white-space: normal;
  }

  .result-footer-note {
    font-size: 0.85rem;
  }

  /* 「運勢エネルギー」などの行見出しが折り返さないよう命式表を小さめにする */
  #result-table {
    font-size: 0.8rem;
  }

  #result-table th.last-col {
    white-space: nowrap;
  }
}
