/* =================================
  診断コンテンツ全体
================================= */
.shindan-wrap {
    width: 100%;
    min-width: 1440px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 32px 0 40px;
    box-sizing: border-box;
    background-color: transparent;
}

#shindan-progress-area {
    width: 960px;
    margin-bottom: 40px;
}

.diag-progress-container {
    width: 100%;
    padding-top: 0px;
}

.diag-progress-track {
    width: 100%;
    position: relative;
    min-width: 0;
}

@keyframes shindan-trot {
    0%,
    100% {
        transform: translateX(-50%) translateY(calc(-50% - 5px));
    }

    40%,
    60% {
        transform: translateX(-50%) translateY(calc(-50% - 13px));
    }
}

.diag-step-chara--left {
    position: absolute;
    top: 50%;
    width: 50px;
    transform: translateX(-75%) translateY(calc(-50% - 5px));
    transition: left 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.diag-step-chara--left img {
    width: 100%;
    height: auto;
    display: block;
}

.diag-step-chara--right {
    position: absolute;
    top: 50%;
    width: 80px;
    left: 100%;
    transform: translateX(-50%) translateY(calc(-50% - 5px));
}

.diag-step-chara--right img {
    width: 100%;
    height: auto;
    display: block;
}

.diag-progress-text {
    margin-bottom: 10px;
    font-weight: bold;
    font-size: 16px;
}

.diag-progress-bar-bg {
    width: 100%;
    height: 10px;
    background: var(--bar-bg-color, #eee);
    border-radius: 5px;
    overflow: hidden;
}

.diag-progress-bar-inner {
    height: 100%;
    background: var(--bar-color, #d43f60);
    transition: width 0.3s ease;
}

.diag-progress-count {
    margin-top: 32px;
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.4;
    position: relative;
}

/* 内部コンテンツエリア */
.shindan-inner {
    width: 1200px;
    margin: 0 auto;
    position: relative;
    background-color: transparent;
    background-size: 100% auto;
    background-position: center top;
    background-repeat: no-repeat;
}

/* 状態別背景設定 */
.shindan-wrap[data-state="playing"] .shindan-inner {
    background-image: var(--bg-pc);
}

.shindan-wrap[data-state="top"] .shindan-inner,
.shindan-wrap[data-state="result"] .shindan-inner {
    background-image: none;
}

/* アニメーション設定 */
#shindan-app {
    transition: opacity 0.3s ease, transform 0.3s ease;
    opacity: 1;
    transform: translateY(0);
}

#shindan-app.is-animating {
    opacity: 0;
    transform: translateY(10px);
}

/* =================================
  診断TOP画面
================================= */
.diag-kv-wrap {
    width: 100%;
}

.diag-kv-wrap img {
    width: 100%;
    height: auto;
    display: block;
}

.diag-start-action-wrap {
    position: absolute;
    bottom: 6%;
    text-align: center;
    width: 100%;
}

/* =================================
  設問画面
================================= */
.shindan-q-title {
    font-family: 'Noto Serif JP', sans-serif;
    text-align: center;
    margin: clamp(30px, calc(30px + (100vw - 768px) / 16), 60px) 0;
    font-size: clamp(20px, 1.04vw + 12px, 24px);
    color: #fff;
    font-weight: 700;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 400px));
    justify-content: center;
    column-gap: 16px;
    row-gap: clamp(16px, calc(16px + (100vw - 768px) / 120), 20px);
}

.opt-btn.is-selected {
    outline: 4px solid #fff;
    background-color: #fff;
}

.opt-btn.is-selected img {
    opacity: 0.8;
}

.shindan-nav {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: clamp(24px, calc(24px + (100vw - 768px) / 18.46), 50px);
}

.nav-btn {
    font-family: 'Noto Serif JP', sans-serif;
    width: 200px;
    height: 50px;
    color: #fff;
    border: 2px solid #452D15;
    background: #452D15;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 700;
    font-size: 16px;
    transition: 0.3s;
}

.nav-btn.next {
    background: #F4E4C6;
    color: #452D15;
    border-color: #F4E4C6;
}

.nav-btn:disabled {
    background: #eee;
    color: #aaa;
    border-color: #ddd;
    cursor: not-allowed;
}

.nav-btn:hover:not(:disabled) {
    opacity: 0.8;
}

.nav-btn.nav-btn--img {
    width: 360px;
    height: auto;
    background: transparent;
    border: none;
    padding: 0;
}

.nav-btn.nav-btn--img picture {
    display: block;
    line-height: 0;
}

.nav-btn.nav-btn--img img {
    display: block;
    width: 100%;
    height: auto;
}

.shindan-nav:has(.nav-btn--img) .nav-btn:not(.nav-btn--img) {
    height: auto;
    align-self: stretch;
}

/* =================================
  診断結果画面
================================= */
.result-view {
    width: 100%;
    text-align: center;
    display: block;
    visibility: visible;
    opacity: 1;
}

.result-main-img {
    max-width: 960px;
    margin: 0 auto 30px;
}

.result-main-img img {
    width: 100%;
    height: auto;
    display: block;
}

.result-desc {
    text-align: left;
    margin: 0 auto 40px;
    max-width: 1200px;
    line-height: 1.6;
    font-size: 24px;
    font-weight: 500;
}

.result-footer-grid {
    display: flex;
    gap: 30px;
    justify-content: center;
    margin-bottom: 40px;
}

.footer-box {
    flex: 0 1 465px;
    background: #FEC6CD;
    padding: 24px;
    box-sizing: border-box;
    text-align: center;
}

.footer-box h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #986668;
}

.share-btns,
.store-btns {
    display: flex;
    justify-content: center;
    gap: 24px;
}

.share-btns a img {
    width: 51px;
    height: 51px;
    object-fit: contain;
}

.store-btns a img {
    height: 50px;
    width: auto;
}

.result-action-btns {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
}

.shindan-finish-area {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 500px;
}

/* =================================
  ボタン共通スタイル
================================= */
.btn-common {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin: 0 auto;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    font-weight: bold;
    font-size: 18px;
    background-color: #FEC6CD;
    color: #986668;
    padding: 0;
    transition: 0.3s;
    overflow: hidden;
    position: relative;
}

#js-start-btn,
#js-view-result,
.btn-start-action,
.btn-result-action,
.opt-btn {
    max-width: 400px;
}

.btn-chara-detail,
.btn-retry,
.result-action-btns .btn-common {
    max-width: 320px;
    height: 60px;
}

.btn-common:has(img) {
    background-color: transparent;
}

.btn-common img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.btn-image-stack {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 選択肢テキスト（画像あり時）
   画像内に文言が入っているため視覚的には表示しない。
   ただし DOM からは削除しない：
     ・GTM の option_text 計測（ルート式は textContent から取得）
     ・スクリーンリーダーへのボタン名の提供
   ※ display:none / visibility:hidden にすると読み上げ・計測が壊れるので使わないこと */
.btn-image-stack .stack-text {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
    pointer-events: none;
}

.btn-common:hover:not(:disabled) {
    opacity: 0.8;
}

.shindan-reset {
    margin: clamp(16px, calc(16px + (100vw - 768px) / 60), 24px) 0 32px;
    text-align: center;
}

.shindan-reset-finish {
    margin-top: 56px;
}

.reset-link {
    background: none;
    border: none;
    color: #fff;
    font-family: 'Noto Serif JP', sans-serif;
    font-size: 16px;
    font-weight: 500;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
}

.reset-link:hover {
    opacity: 0.7;
}

.ShinandResult_img {
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 60px;
}

/* =================================
  アクションボタン（音声・ダウンロード）
================================= */
.result-media-btns {
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: flex-end;
    flex-wrap: wrap;
    max-width: 800px;
    margin: 0 auto 28px;
}

.result-media-dl-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    flex: 1;
    max-width: calc(50% - 10px);
}

.result-media-dl-preview-link {
    display: block;
    width: 100%;
    line-height: 0;
    border-radius: 8px;
    overflow: hidden;
    transition: opacity 0.2s;
}

.result-media-dl-preview-link:hover {
    opacity: 0.85;
}

.result-media-dl-preview-link img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 420px;
    object-fit: contain;
}

.result-media-btn {
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.05em;
    cursor: pointer;
    text-decoration: none;
    transition: 0.2s, color 0.2s, opacity 0.2s;
    border: 2px solid #d43f60;
    color: #d43f60;
    background: #fff;
}

.result-media-btn:not(.result-media-btn--img):hover {
    opacity: 0.75;
}

.result-media-btn--audio:not(.result-media-btn--img).is-playing {
    background: #d43f60;
    color: #fff;
}

.result-media-btn--img {
    padding: 0;
    border: 2px solid transparent;
    background: transparent;
    border-radius: 4px;
}

.result-media-btn--img img {
    display: block;
    max-width: 100%;
    height: auto;
}

.result-media-btn--img:hover {
    opacity: 0.8;
}

.result-media-btn--audio.result-media-btn--img.is-playing {
    border-color: #DB6143;
    opacity: 0.65;
}

.result-gallery {
    max-width: 800px;
    margin: 0 auto 40px;
}

.gallery-main {
    width: 100%;
}

.gallery-main-item {
    display: none;
}

.gallery-main-item.is-active {
    display: block;
}

.gallery-main-item picture,
.gallery-main-item img {
    width: 100%;
    height: auto;
    display: block;
}

.gallery-main-item img {
    box-shadow: 0 3px 10px rgba(227, 195, 131, 0.4);
}

.gallery-thumbs {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.gallery-thumb {
    padding: 0;
    cursor: pointer;
    overflow: hidden;
    flex-shrink: 0;
    transition: border-color 0.2s;
    box-shadow: 0 3px 10px rgba(227, 195, 131, 0.4);
}

.gallery-thumb.is-active {
    border-color: #DB6143;
}

.gallery-thumb picture {
    display: block;
    width: 100%;
    height: 100%;
}

.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ShinandResult {
    width: 100%;
    box-sizing: border-box;
    padding: 0 20px;
}

.ShinandResult_section-head {
    max-width: 960px;
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    margin: 40px auto 24px;
}

.ShinandResult_name {
    max-width: 1200px;
    font-size: 50px;
    font-weight: 700;
    text-align: center;
    color: #DB6143;
    margin: 0 auto 40px;
}

.ShinandResult_desc {
    font-size: 24px;
    font-weight: 500;
    line-height: 1.6;
    text-align: center;
    max-width: 1200px;
    margin: 0 auto 108px;
}

.ShinandResult_2col {
    display: flex;
    flex-wrap: wrap;
    gap: 56px;
    max-width: 1200px;
    margin: 0 auto 160px;
    align-items: flex-start;
}

.ShinandResult_left {
    flex: 0 0 350px;
    width: 350px;
}

.ShinandResult_right {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.ShinandResult_desc2 {
    font-size: 24px;
    font-weight: 500;
    line-height: 1.6;
    text-align: left;
    width: 100%;
    margin: 0 0 48px;
}

.ShinandResult_right .result-media-btns {
    justify-content: center;
    gap: clamp(16px, 3vw, 32px);
    margin: 0 0 48px;
    flex-wrap: nowrap;
}

.ShinandResult_right .result-media-btn {
    box-sizing: border-box;
    max-height: 50px;
    height: auto;
    flex: 0 1 200px;
    min-width: 0;
}

.ShinandResult_right .result-media-btn--img img {
    width: 100%;
    height: auto;
    object-fit: contain;
}

.ShinandResult_right .gallery-thumbs {
    justify-content: center;
    gap: clamp(8px, 2vw, 24px);
    margin: 0;
    flex-wrap: nowrap;
}

.ShinandResult_right .gallery-thumb {
    width: 100%;
    max-width: 155px;
    flex: 1 1 0;
    min-width: 0;
    height: auto;
    padding: 0;
    border: 2px solid transparent;
    outline: none;
    background: transparent;
    border-radius: 4px;
    overflow: hidden;
}

.ShinandResult_right .gallery-thumb img {
    transition: transform 0.3s ease;
}

.ShinandResult_right .gallery-thumb.is-active {
    border-color: #DB6143;
}

.ShinandResult_right .gallery-thumb:not(.is-active):hover img {
    transform: scale(1.1);
}

.ShinandResult_share {
    width: 100%;
    max-width: 580px;
    margin: 40px auto 56px;
    background-image: url('/wp-content/themes/ikemen/title/sengokueien/shindan/images/share-bg.webp');
    background-size: cover;
    background-position: center;
    border: 2px solid #926E4A;
    border-radius: 5px;
    padding: 24px;
    text-align: center;
    box-sizing: border-box;
}

.ShinandResult_share-head {
    font-size: 24px;
    font-weight: 700;
    color: #452D15;
    margin: 0 0 24px;
}

.ShinandResult_share-btns {
    display: flex;
    justify-content: center;
    gap: 40px;
}

.ShinandResult_share-btns a {
    display: inline-block;
    transition: opacity 0.3s ease;
}

.ShinandResult_share-btns a:hover {
    opacity: 0.8;
}

.ShinandResult_share-btns img {
    width: 54px;
    height: 54px;
    object-fit: contain;
}

.ShinandResult_btn--retry {
    display: block;
    width: fit-content;
    margin: 0 auto 100px;
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    color: #452D15;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.ShinandResult_btn--retry:hover {
    opacity: 0.7;
}

.ShinandResult_btn--retry span {
    border-bottom: 1px solid #452D15;
    padding-bottom: 0px;
}

/* =================================
   レスポンシブ対応
================================= */
@media (max-width: 1439px) {
    .shindan-wrap {
        min-width: 100%;
        padding: 60px 20px;
    }
}

@media (max-width: 1024px) {

    #shindan-progress-area,
    .shindan-inner {
        width: 100%;
        padding: 0 16px;
        box-sizing: border-box;
    }
}

@media (max-width: 767px) {
    .shindan-q-title {
        font-size: clamp(16px, 14px + 0.53vw, 18px);
        margin: clamp(24px, 6.4vw, 40px) 0;
    }

    .shindan-wrap {
        padding: 40px 0;
    }

    .shindan-wrap[data-state="playing"] .shindan-inner {
        background-image: var(--bg-sp);
        background-size: cover;
        background-position: center bottom;
        padding-bottom: 32px;
    }

    #shindan-progress-area,
    .shindan-inner {
        width: 96%;
        padding: 0 15px;
        box-sizing: border-box;
    }

    .diag-step-chara--left {
        width: 56px;
    }

    .diag-step-chara--right {
        width: 56px;
    }

    .diag-progress-container {
        padding-top: 24px;
    }

    .diag-progress-count {
        margin-top: 42px;
    }

    .options-grid {
        grid-template-columns: 1fr;
        gap: clamp(10px, 2.67vw, 16px);
        padding: 0 6vw;
    }

    .btn-image-stack {
        display: block;
    }

    .opt-btn {
        height: auto;
    }

    .opt-btn img {
        width: 100%;
    }

    .shindan-nav {
        gap: 20px;
        margin-top: clamp(24px, 6.4vw, 40px);
        display: flex;
        justify-content: center;
        padding: 0 15px;
    }

    .nav-btn {
        width: 140px;
        height: 44px;
    }

    .nav-btn.nav-btn--img {
        width: 260px;
    }

    .shindan-reset {
        margin: 20px 0 0;
    }

    .result-media-dl-preview-link img {
        max-height: 280px;
    }

    .result-media-btn:not(.result-media-btn--img) {
        padding: 10px 20px;
        font-size: 13px;
    }

    .ShinandResult_img {
        padding: 40px 15px 0;
    }

    .result-gallery {
        padding: 0 15px;
        box-sizing: border-box;
    }

    .gallery-thumb {
        width: 80px;
        height: 80px;
    }

    .ShinandResult {
        padding: 0;
    }
    .ShinandResult_2col {
        flex-direction: column;
        gap: 32px;
        padding: 0;
        margin: 0 auto 86px;
    }

    .ShinandResult_left {
        flex: none;
        width: 100%;
    }

    .ShinandResult_left .gallery-main {
        display: flex;
        align-items: center;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
        gap: 0.66vw;
        padding: 0px 26.67vw;
        box-sizing: border-box;
    }

    .ShinandResult_left .gallery-main::-webkit-scrollbar {
        display: none;
    }

    .ShinandResult_left .gallery-main-item {
        display: block !important;
        flex: 0 0 46.66vw;
        width: 46.66vw;
        scroll-snap-align: center;
    }

    .ShinandResult_left .gallery-main-item img {
        width: 100%;
        height: auto;
        transform-origin: center center;
        transition: transform 0.3s ease;
        transform: scale(0.8571);
    }

    .ShinandResult_left .gallery-main-item.is-active img {
        transform: scale(1);
    }

    .ShinandResult_section-head {
        font-size: clamp(18px, 16px + 0.53vw, 20px);
    }

    .ShinandResult_name {
        font-size: clamp(20px, 5.33vw, 40px);
        padding: 0 15px;
    }

    .ShinandResult_desc {
        font-size: clamp(16px, 14px + 0.53vw, 18px);
        margin: 0 auto 40px;
        padding: 0 15px;
    }

    .ShinandResult_right {
        display: flex;
        flex-direction: column;
        padding: 0 15px;
        width: 100%;
        box-sizing: border-box;
    }

    .ShinandResult_right .gallery-thumbs {
        order: 1;
        gap: 19px;
        margin: 0 auto 48px;
        max-width: 252px;
    }
    .ShinandResult_right .gallery-thumb {
        width: clamp(14px, 8px + 1.6vw, 20px);
        max-width: none;
        height: clamp(14px, 8px + 1.6vw, 20px);
        border-radius: 50%;
        background-color: #ECC7A2;
        opacity: 0.5;
        border: none;
        box-shadow: none;
        flex: none;
    }
    .ShinandResult_right .gallery-thumb.is-active {
        background-color: #DB6143;
        opacity: 1;
    }
    .ShinandResult_right .gallery-thumb img {
        display: none;
    }
    .ShinandResult_right .result-media-btn {
        max-height: 55px;
    }
    .ShinandResult_right .result-media-btns {
        order: 2;
        gap: clamp(16px, 4vw, 32px);
        margin: 0 auto 40px;
        flex-direction: row;
    }

    .ShinandResult_desc2 {
        order: 3;
        font-size: clamp(16px, 14px + 0.53vw, 18px);
        margin: 0;
        text-align: center;
    }

    .ShinandResult_share {
        width: 580px;
        max-width: 92%;
        margin: 56px auto 56px;
        padding: 32px 15px;
    }

    .ShinandResult_share-head {
        font-size: clamp(18px, 12px + 1.6vw, 24px);
        margin: 0 0 20px;
    }

    .ShinandResult_btn--retry {
        font-size: clamp(18px, 12px + 1.6vw, 24px);
        margin: 0 auto 44px;
    }
}

/* =================================
   Responsive Design (SP: ～500px)
================================= */
@media screen and (max-width: 500px) {
    #js-start-btn {
        max-width: 300px;
    }
}

/* =================================
   診断開始ボタン アニメーション
================================= */
@keyframes poyopoyo {
    0% {
        transform: scale(1);
    }
    15% {
        transform: scale(1.05);
    }
    30% {
        transform: scale(0.97);
    }
    45% {
        transform: scale(1.02);
    }
    60%, 100% {
        transform: scale(1);
    }
}

#js-start-btn {
    animation: poyopoyo 2s infinite;
    transform-origin: center center;
}