/* ============================================================
   ゴルフ診断（非会員ナーチャリング）
   LINEの中ブラウザで開く前提のスマホ優先レイアウト。
   会員導線の main.css には手を入れず、このファイルだけで完結させる。
   ============================================================ */

:root {
    --dg-navy:   #17244A;   /* 診断クリエイティブのネイビー */
    --dg-mint:   #D8E7E8;   /* 選択肢A側のパステル */
    --dg-pink:   #F7DCE2;   /* 選択肢B側のパステル */
    --dg-mint2:  #E5F0F0;   /* 4択のC側 */
    --dg-pink2:  #FBEAEE;   /* 4択のD側 */
    --dg-paper:  #F6F1EA;
    --dg-radius: 14px;
}

.sg-diag-main { padding-top: 16px; }

.sg-diag {
    max-width: 560px;
}

/* ---------------- 見出し ---------------- */
.sg-diag-head {
    text-align: center;
    padding: 8px 0 20px;
}
/* ロゴ（logoA3.png）。紺一色の横長なので、白い背景の上でだけ使う。
   幅は px で決め打ちにせず、狭い画面では画面幅に追従させる。 */
.sg-diag-logo {
    display: block;
    width: 190px;
    max-width: 62%;
    height: auto;
    margin: 0 auto;
}

.sg-diag-head__brand { margin-bottom: 10px; }

/* 診断本体（/diagnosis/{スラッグ}/）のロゴ */
.sg-diag-brand {
    padding-top: 4px;
    margin-bottom: 6px;
}
.sg-diag-head__title {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--dg-navy);
    margin: 2px 0 6px;
}
.sg-diag-head__lead {
    font-size: 0.85rem;
    color: var(--color-text-muted, #64748B);
}

/* ---------------- セクション ---------------- */
/* ※ かつては1ページにSGPT診断とゴルフパターン診断を並べていたため
   セクション見出し（__title / __lead）を持っていたが、
   診断ごとに独立したベースページへ分けたので不要になった。
   ページの見出しは .sg-diag-head を使う。 */
.sg-diag-section { margin-bottom: 32px; }
.sg-diag-section:last-child { margin-bottom: 0; }

/* ※ 2×2のレベル選択カード（.sg-diag-levels / .sg-diag-level-card）は廃止。
   同じ4レベルが下のアコーディオンと二重に並んで分かりにくかったため、
   アコーディオンだけに統一した。 */

/* ---------------- ★スコア入力ゲート（2026-08-18 ／ 2026-08-20 主役化） ----------------
   入口で聞くのはベストスコア1つだけ。入れるとその人のレベルの診断へ進む。
   ★2026-08-20：一覧とSGPTへの導線を外し、この画面だけにしたので、
     数字の入力を画面の主役として大きく取っている。 */
.sg-diag-gate {
    margin-top: 24px;
    padding: 28px 18px 24px;
    background: #fff;
    border-radius: var(--dg-radius);
    text-align: center;
}

.sg-diag-gate__title {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--dg-navy);
    line-height: 1.5;
}

.sg-diag-gate__lead {
    margin-top: 8px;
    font-size: 0.82rem;
    line-height: 1.9;
    opacity: 0.75;
}

.sg-diag-gate__row {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
    margin: 22px 0 4px;
}

.sg-diag-gate__input {
    width: 210px;
    padding: 10px 12px;
    background: var(--dg-paper);
    border: 0;
    border-bottom: 3px solid var(--dg-navy);
    border-radius: 12px 12px 0 0;
    color: var(--dg-navy);
    font-size: 3.2rem;
    font-weight: 800;
    line-height: 1.2;
    text-align: center;
    -moz-appearance: textfield;     /* 数字の上下ボタンを消す */
}
.sg-diag-gate__input::-webkit-outer-spin-button,
.sg-diag-gate__input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.sg-diag-gate__unit {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--dg-navy);
}

.sg-diag-gate__error {
    margin-top: 10px;
    color: #c0392b;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.7;
}

.sg-diag-gate__submit {
    display: block;
    width: 100%;
    margin-top: 22px;
    padding: 18px;
    border: 0;
    border-radius: 999px;
    background: var(--dg-navy);
    color: #fff;
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 800;
    cursor: pointer;
}
.sg-diag-gate__submit:active { filter: brightness(1.15); }

/* 「まだ回ったことがない／わからない」も**ボタン**にする（リンクだと押されないため） */
.sg-diag-gate__skip {
    display: block;
    width: 100%;
    margin-top: 12px;
    padding: 13px;
    border: 2px solid var(--dg-navy);
    border-radius: 999px;
    background: #fff;
    color: var(--dg-navy);
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.5;
    cursor: pointer;
}
.sg-diag-gate__skip:active { background: var(--dg-paper); }

/* 2回目以降の一言（前に入れたスコアが入っていることの説明） */
.sg-diag-gate__hint {
    margin-top: 14px;
    font-size: 0.75rem;
    line-height: 1.8;
    opacity: 0.65;
}

/* ---------------- あなたのレベル（2回目以降） ---------------- */
.sg-diag-me {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 22px;
    padding: 12px 14px;
    background: #fff;
    border-radius: 12px;
    font-size: 0.86rem;
}

.sg-diag-me__text { color: var(--dg-navy); }
.sg-diag-me__level { font-weight: 800; }
.sg-diag-me__score {
    font-size: 0.78rem;
    opacity: 0.7;
}

.sg-diag-me__redo {
    flex: 0 0 auto;
    border: 0;
    background: transparent;
    color: var(--dg-navy);
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}

/* 自分のレベルだけ開いているときの「すべての診断を見る」 */
.sg-diag-all {
    margin-top: 14px;
    text-align: center;
}
.sg-diag-all__btn {
    border: 0;
    background: transparent;
    color: var(--dg-navy);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}

/* ---------------- レベル別アコーディオン ---------------- */
.sg-diag-accs {
    margin-top: 16px;
    display: grid;
    gap: 10px;
}

.sg-diag-acc {
    border-radius: 12px;
    overflow: hidden;
    background: var(--dg-navy);
}

.sg-diag-acc__head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    color: #fff;
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    list-style: none;               /* Firefox の三角を消す */
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0.12);
}
.sg-diag-acc__head::-webkit-details-marker { display: none; }   /* Safari の三角を消す */

/* ▽ マーク（開くと ▲ に回る） */
.sg-diag-acc__mark {
    flex: 0 0 auto;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 7px solid #fff;
    transition: transform 0.2s ease;
}
.sg-diag-acc[open] .sg-diag-acc__mark { transform: rotate(180deg); }

.sg-diag-acc__label { flex: 0 0 auto; }

/* 目安スコア。狭い画面では折り返さず、入らなければ省略する */
.sg-diag-acc__note {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 0.68rem;
    font-weight: 600;
    opacity: 0.65;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sg-diag-acc__count {
    flex: 0 0 auto;
    font-size: 0.7rem;
    font-weight: 700;
    opacity: 0.7;
}

.sg-diag-acc__list {
    list-style: none;
    display: grid;
    gap: 8px;
    padding: 4px 10px 12px;
}

.sg-diag-item {
    display: block;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 10px;
    padding: 12px 14px;
    color: #fff;
}
.sg-diag-item:hover { background: rgba(255, 255, 255, 0.18); color: #fff; }
.sg-diag-item__title {
    display: block;
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.5;
}
.sg-diag-item__catch {
    display: block;
    margin-top: 3px;
    font-size: 0.72rem;
    line-height: 1.5;
    opacity: 0.75;
}

/* ---- もう受けた診断（グレーアウト） ----
 * 押せなくはしない。受け直せるようにしたうえで「もう受けた」と分かる見た目にする。 */
.sg-diag-item.is-done {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.12);
    opacity: 0.55;
}
.sg-diag-item.is-done:hover {
    background: rgba(255, 255, 255, 0.09);
    opacity: 0.8;
}
.sg-diag-item__done {
    display: inline-block;
    margin-top: 7px;
    padding: 2px 8px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 999px;
    font-size: 0.66rem;
    font-weight: 700;
    line-height: 1.6;
    white-space: nowrap;
    overflow: hidden;
    max-width: 100%;
    text-overflow: ellipsis;
}

/* ---------------- レベル別一覧（旧レイアウト用・残置） ---------------- */
.sg-diag-subhead {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}
.sg-diag-subhead__badge {
    font-size: 0.85rem;
    font-weight: 800;
    color: #fff;
    background: var(--dg-navy);
    padding: 5px 14px;
    border-radius: 999px;
    flex-shrink: 0;
}
.sg-diag-subhead__note {
    font-size: 0.74rem;
    color: var(--color-text-muted, #64748B);
    line-height: 1.4;
}

.sg-diag-list { list-style: none; display: grid; gap: 12px; }

.sg-diag-card {
    display: flex;
    gap: 12px;
    align-items: stretch;
    padding: 12px;
    background: var(--color-white, #fff);
    border-radius: var(--dg-radius);
    box-shadow: 0 2px 10px rgba(23, 36, 74, 0.08);
    color: var(--dg-navy);
}
.sg-diag-card__thumb {
    flex: 0 0 84px;
    width: 84px;
    border-radius: 10px;
    overflow: hidden;
    background: var(--dg-mint);
}
.sg-diag-card__thumb img { width: 100%; height: 100%; object-fit: cover; }
.sg-diag-card__body {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}
.sg-diag-card__title { font-size: 0.95rem; font-weight: 700; line-height: 1.45; }
.sg-diag-card__catch {
    font-size: 0.74rem;
    color: var(--color-text-muted, #64748B);
    line-height: 1.5;
}
.sg-diag-card__cta {
    align-self: flex-start;
    margin-top: auto;
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
    background: var(--dg-navy);
    padding: 5px 14px;
    border-radius: 999px;
}

.sg-diag-empty {
    padding: 32px 0;
    text-align: center;
    color: var(--color-text-muted, #64748B);
    font-size: 0.88rem;
}

.sg-diag-back {
    margin-top: 22px;
    text-align: center;
    font-size: 0.82rem;
}
.sg-diag-back a { color: var(--dg-navy); font-weight: 600; }

/* ---------------- 診断本体：タイトル ---------------- */
.sg-diag-title { text-align: center; padding: 4px 0 16px; }
.sg-diag-title__level {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 800;
    color: #fff;
    background: var(--dg-navy);
    padding: 3px 12px;
    border-radius: 999px;
    margin-bottom: 8px;
}
.sg-diag-title h1 {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--dg-navy);
    line-height: 1.45;
}

/* ---------------- 質問 ---------------- */
.sg-diag-progress {
    text-align: center;
    margin-bottom: 10px;
    color: var(--dg-navy);
}
.sg-diag-progress__now   { font-size: 1.05rem; font-weight: 800; }
.sg-diag-progress__total { font-size: 0.8rem; opacity: 0.6; }

/* 画像あり：画像の上にタップ領域を重ねる */
.sg-diag-q__figure {
    position: relative;
    border-radius: var(--dg-radius);
    overflow: hidden;
}
.sg-diag-q__figure img { width: 100%; display: block; }
.sg-diag-q__overlay {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
}
.sg-diag-q[data-choices="4"] .sg-diag-q__overlay {
    grid-template-rows: repeat(2, 1fr);
}
.sg-diag-q__hit {
    border: 0;
    background: transparent;
    cursor: pointer;
    -webkit-tap-highlight-color: rgba(23, 36, 74, 0.12);
}
.sg-diag-q__hit:active { background: rgba(23, 36, 74, 0.08); }

/* 画像なし：同じデザインの文字カードを組み立てる */
.sg-diag-q__banner {
    position: relative;
    z-index: 2;
    background: var(--dg-navy);
    color: #fff;
    font-size: 1.02rem;
    font-weight: 800;
    line-height: 1.5;
    text-align: center;
    padding: 16px 18px;
    border-radius: 12px;
    margin-bottom: -10px;
}
.sg-diag-q__banner::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -9px;
    width: 20px;
    height: 10px;
    transform: translateX(-50%);
    background: var(--dg-navy);
    clip-path: polygon(0 0, 100% 0, 50% 100%);
}
.sg-diag-q__panel {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2px;
    border-radius: var(--dg-radius);
    overflow: hidden;
}
.sg-diag-q[data-choices="4"] .sg-diag-q__panel {
    grid-template-columns: repeat(2, 1fr);
}
.sg-diag-q__choice {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    min-height: 200px;
    padding: 34px 12px 18px;
    border: 0;
    cursor: pointer;
    font-family: inherit;
    color: var(--dg-navy);
    -webkit-tap-highlight-color: rgba(23, 36, 74, 0.12);
    background-image: repeating-linear-gradient(
        -45deg,
        rgba(255, 255, 255, 0.55) 0 10px,
        rgba(255, 255, 255, 0) 10px 20px
    );
}
.sg-diag-q__choice--a { background-color: var(--dg-mint); }
.sg-diag-q__choice--b { background-color: var(--dg-pink); }
.sg-diag-q__choice--c { background-color: var(--dg-mint2); }
.sg-diag-q__choice--d { background-color: var(--dg-pink2); }
.sg-diag-q__choice:active { filter: brightness(0.96); }

.sg-diag-q__badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--dg-navy);
    color: #fff;
    font-size: 0.88rem;
    font-weight: 800;
}
.sg-diag-q__label {
    display: block;
    width: 100%;
    background: #fff;
    border-radius: 10px;
    padding: 12px 8px;
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1.45;
    text-align: center;
    box-shadow: 0 2px 8px rgba(23, 36, 74, 0.1);
}

.sg-diag-q__back {
    display: block;
    margin: 16px auto 0;
    border: 0;
    background: transparent;
    font-family: inherit;
    font-size: 0.8rem;
    color: var(--color-text-muted, #64748B);
    cursor: pointer;
}

/* ---------------- 結果 ---------------- */
.sg-diag-result__figure {
    border-radius: var(--dg-radius);
    overflow: hidden;
}
.sg-diag-result__figure img { width: 100%; display: block; }

.sg-diag-result__banner {
    position: relative;
    z-index: 2;
    background: var(--dg-navy);
    color: #fff;
    font-size: 1.02rem;
    font-weight: 800;
    text-align: center;
    padding: 15px 18px;
    border-radius: 12px;
    margin-bottom: -10px;
}
.sg-diag-result__banner::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -9px;
    width: 20px;
    height: 10px;
    transform: translateX(-50%);
    background: var(--dg-navy);
    clip-path: polygon(0 0, 100% 0, 50% 100%);
}
.sg-diag-result__card {
    background: var(--dg-paper);
    border-radius: var(--dg-radius);
    padding: 34px 18px 24px;
    text-align: center;
    color: var(--dg-navy);
}
.sg-diag-result__mark {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    padding-bottom: 8px;
    border-bottom: 3px solid var(--dg-navy);
    margin-bottom: 14px;
}
.sg-diag-result__letter { font-size: 3rem; font-weight: 800; line-height: 1; }
.sg-diag-result__suffix { font-size: 1.25rem; font-weight: 800; }
.sg-diag-result__name {
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.5;
    margin-bottom: 16px;
}
.sg-diag-result__text {
    background: #fff;
    border-radius: 12px;
    padding: 16px 14px;
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.75;
    white-space: pre-wrap;
    box-shadow: 0 2px 8px rgba(23, 36, 74, 0.08);
}

/* 詳細文（3段落）。キャッチの下に読ませる本文。 */
.sg-diag-result__detail {
    margin-top: 14px;
    background: #fff;
    border-radius: var(--dg-radius);
    padding: 22px 18px;
    color: var(--dg-navy);
    text-align: left;
    box-shadow: 0 2px 8px rgba(23, 36, 74, 0.08);
}
.sg-diag-result__detail-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 14px;
    padding: 0;
    font-size: 0.95rem;
    font-weight: 800;
    line-height: 1.4;
    color: var(--dg-navy);
    letter-spacing: 0.04em;
}
.sg-diag-result__detail-title::after {
    content: '';
    flex: 1;
    height: 2px;
    background: var(--dg-navy);
    opacity: 0.15;
}
.sg-diag-result__para {
    font-size: 0.9rem;
    line-height: 1.9;
    white-space: pre-wrap;
}
.sg-diag-result__para + .sg-diag-result__para { margin-top: 1.2em; }
.sg-diag-result__para strong { font-weight: 800; }

.sg-diag-cta {
    display: block;
    margin-top: 18px;
    padding: 16px;
    border-radius: 999px;
    background: var(--color-line, #06C755);
    color: #fff;
    font-size: 1rem;
    font-weight: 800;
    text-align: center;
    box-shadow: 0 4px 14px rgba(6, 199, 85, 0.3);
}
.sg-diag-cta:hover { opacity: 0.9; color: #fff; }

.sg-diag-result__actions {
    display: flex;
    justify-content: center;
    margin-top: 18px;
    font-size: 0.82rem;
}
.sg-diag-result__other { color: var(--dg-navy); font-weight: 600; text-decoration: underline; }

.sg-diag-noscript {
    padding: 24px 16px;
    background: #fff;
    border-radius: var(--dg-radius);
    text-align: center;
    font-size: 0.88rem;
}

/* ---------------- 動作確認用（?sgdebug=1 のときだけ表示） ---------------- */
.sg-diag-debug {
    background: #1e1e2e;
    color: #d6f5d6;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 14px;
    font-family: ui-monospace, Menlo, Consolas, monospace;
    font-size: 0.72rem;
    line-height: 1.7;
    word-break: break-all;
}
.sg-diag-debug strong { display: block; color: #ffd479; margin-bottom: 6px; }

/* ---------------- 画面が広いとき ---------------- */
@media (min-width: 600px) {
    .sg-diag-q__choice { min-height: 240px; }
    .sg-diag-head__title { font-size: 2rem; }
}
