/* --- 視認性特化のリッチデザイン --- */
:root {
    --bg-color: #0b1021;
    --text-white: #fff;
    --text-black: #000;
    --text-gold: #A28117;
    --panel-bg: rgba(0, 0, 0, 0.85);
    --border-color: rgba(212, 175, 55, 0.6);
}

a,a:hover,a:visited{
    color: inherit;
}
button,button:hover,a:visited{
    color: inherit;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--text-gold);
    /* font-family: "Shippori Mincho", serif; */
    font-family: "Yu Gothic Medium", "Yu Gothic", "YuGothic", "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Meiryo", sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    transition: background 0.3s ease;
}
body.is-top-page::before {
    background: rgba(0, 0, 0, 0) !important;
}

#game-container {
    width: 95%;
    max-width: 1200px;
    min-height: 720px;
    margin: 20px auto;
    /* background-color: var(--panel-bg); */
    background: rgba(255, 255, 255, 0.7);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(10px);
}

/* --- ヘッダー --- */
header {
    position: relative;
    width: 100%;
    padding: 15px 0;
    text-align: center;
    border-bottom: 1px solid rgba(212, 175, 55, 0.3);
    z-index: 10;
}
h2 {
    margin: 0;
    letter-spacing: 0.1em;
    line-height: 1.4;
    font-family: "Shippori Mincho", serif;
}
@media (max-width: 768px) {
    h2 {
        line-height: 1;
    }
}

.header-white {
    color: var(--text-gold);
    font-size: 2.3rem;
    letter-spacing: 0.02em;
    display: inline-block;
    vertical-align: middle;
    margin-right: 5px;
}
.header-gold {
    color: var(--text-black);
    font-size: 3.2rem;
    font-weight: bold;
    line-height: 1.2;
    display: inline-block;
    vertical-align: middle;
}
.header-gold-sub {
    color: var(--text-black);
    font-size: 2.3rem;
    font-weight: bold;
    line-height: 1.2;
    display: inline-block;
    vertical-align: middle;
}
.header-white-large {
    color: var(--text-gold);
    font-size: 2rem;
    font-weight: bold;
    line-height: 1.2;
    display: inline-block;
    vertical-align: middle;
}
@media (max-width: 768px) {
    .header-gold {
        line-height: 1;
    }
    .header-gold-sub {
        line-height: 1;

    }
    .header-white-large{
        line-height: 1;
    }
}

/* --- セクション制御 --- */
section {
    display: none;
    width: 100%;
    box-sizing: border-box;
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    animation: fadeIn 0.5s ease;
}
section.active {
    display: flex;
    justify-content: center;
}
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* --- 共通レイアウト --- */
.layout-split {
    gap: 40px;
}

#page-top .img-box{
    border:0;
}



/* PC用レイアウト */
@media (min-width: 769px) {
    .layout-split {
        /* flex-direction: row !important; */
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: 40px;
        width: 100%;
        max-width: 1000px;
        margin: 0 auto;
        box-sizing: border-box;
    }
    #page-result.layout-split {
        flex-direction: row-reverse;
    }
    .left-col {
        width: 50%;
        display: flex;
        flex-direction: column;
        justify-content: center;
        /* align-items: flex-end; */
        align-items: center;
    }
    #page-top .left-col {
        align-items: center;
    }
    .right-col {
        width: 50%;
        display: flex;
        flex-direction: column;
        justify-content: center;
    color: var(--text-black);

    }
    #page-top {
        position: relative;
    }
    #page-question .right-col {
        align-items: flex-start;
    }
    #page-result .right-col {
        align-items: center;
    }
    .main-title {
        font-size: 1rem;
        color: var(--text-gold);
        line-height: 1.2;
        text-align: center;
        margin-top: 30px;
        width: 100%;

    }
    .question-text {
        text-align: left;
    }
    .options-area {
        width: 100%;
    }
}

/* スマホ用レイアウト */
@media (max-width: 768px) {
    #game-container {
        margin: 10px;
        border-radius: 10px;
        min-height: 95vh;
    }
    .layout-split {
        flex-direction: column;
        padding: 20px 20px;
        gap: 0px;
    }
    #page-result.layout-split {
        flex-direction: column-reverse;
    }
    .left-col,
    .right-col {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    color: var(--text-black);

    }
    .main-title {
        font-size: 1.2rem;
        margin-bottom: 16px;
        margin-top: 16px;
        text-align: center;
        color: var(--text-gold);
    }
    .question-text {
        text-align: center;
        font-size: 1.4rem;
        margin-top: 12px;
        margin-bottom: 12px!important;
    }
    .header-white {
        font-size: 0.9rem;
    }
    .header-gold {
        font-size: 1.4rem;
    }
    .header-gold-sub {
        font-size: 1.2rem;
    }
    .header-white-large {
        font-size: 1.4rem;
    }
}

/* --- 画像・テキスト・フォーム --- */
.img-box {
    border: 2px solid var(--text-gold);
    /* box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6); */
    border-radius: 12px;
    /* width: 100%; */
    max-width: 100%;
    height: auto;
    max-height: 350px;
    object-fit: contain;
    transition: all 0.3s ease;
}
.img-box:not([src]),
#top-image:not([src]) {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    color: #888;
    border: 2px dashed #555;
    min-height: 300px;
}
.img-box:not([src])::after,
#top-image:not([src])::after {
    content: "IMAGE PLACEHOLDER";
    color: var(--text-black);
    opacity: 0.7;
}

.question-text {
    font-size: clamp(1.2rem, 3.5vw, 1.6rem);
    font-weight: bold;
    margin-bottom: 30px;
    line-height: 1.5;
    color: var(--text-gold);
    display: flex;

}


input[type="text"] {
    padding: 15px;
    font-size: 1.4rem;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid var(--text-gold);
    color: #fff;
    color: var(--text-black);
    border-radius: 8px;
    text-align: center;
    width: 100%;
    max-width: 350px;
    margin-bottom: 40px;
    box-sizing: border-box;
}
@media (max-width: 768px) {
    input[type="text"] {
        margin-bottom: 20px;
    }
}

/* --- ボタン --- */
.btn {
    cursor: pointer;
    text-align: center;
    user-select: none;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.btn-start {
    padding: 20px 0;
    width: 100%;
    max-width: 350px;
    background: var(--text-gold);
    /* color: #888; */
    font-size: 1.3rem;
    font-weight: bold;
    border: 1px solid #555;
    border-radius: 50px;
    pointer-events: none;
}
.btn-start.active {
    background: linear-gradient(to bottom, #d4af37, #aa8c2c);
    color: #000;
    border: none;
    pointer-events: auto;
}

.options-area {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    max-width: 600px;
}
.btn-option {
    padding: 20px 25px;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid rgba(212, 175, 55, 0.3);
    color: #fff;
    font-size: 1.1rem;
    border-radius: 10px;
    text-align: left;
    justify-content: flex-start;
    transition: all 0.3s;
    align-items: flex-start;
}
/* .btn-option:hover {
    background: rgba(212, 175, 55, 0.1);
    border-color: var(--text-gold);
    color: var(--text-black);
    transform: translateX(5px);
} */

/* PCなど、マウスがある時だけホバーを付ける */
@media (hover: hover) {
    .btn-option:hover {
        background: rgba(212, 175, 55, 0.1);
        border-color: var(--text-gold);
        color: var(--text-black);
        transform: translateX(5px);
    }
}

.btn-back {
    margin-top: 30px;
    background: transparent;
    border: 1px solid rgba(0, 0, 0, 0.4);
    font-size: 0.9rem;
    padding: 10px 30px;
    border-radius: 30px;
    color: var(--text-black);
}

/* --- 結果画面 --- */
.result-content {
    flex: 1;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.result-msg {
    font-size: 1.2rem;
    color: var(--text-black);
    margin-bottom: 15px;
    font-weight: bold;
    text-align: center;
}
.result-title {
    font-size: clamp(2rem, 4.2vw, 2.9rem);
    color: var(--text-gold);
    margin: 0 0 20px 0;
    line-height: 1.3;
    font-weight: bold;
    border-bottom: 2px solid rgba(212, 175, 55, 0.4);
    padding-bottom: 20px;
    text-align: center;
    width: 100%;
    white-space: nowrap;
}
.result-desc {
    font-size: 1rem;
    color: #000;
    background: #fff;
    padding: 25px;
    border-radius: 8px;
    line-height: 1.8;
    /* box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5); */
}
.book-visual {
    width: 350px;
    max-width: 100%;
    height: auto;
    /* box-shadow: 0 25px 50px rgba(0, 0, 0, 0.8); */
    border: 2px solid var(--text-gold);
    border-radius: 8px;
    margin: 0 auto;
}
.result-recommend {
    margin-top: 25px;
    text-align: center;
    font-size: 1rem;
    font-weight: bold;
    width: 100%;
}
.recommend-title {
    display: block;
    font-size: clamp(1rem, 4vw, 1.8rem);
    color: var(--text-black);
    margin-top: 8px;
    text-align: center;
    width: 100%;
}
.recommend-title span{
    font-size: clamp(0.8rem, 3vw, 1.4rem);
}

.result-buttons {
    display: flex;
    gap: 15px;
    width: 100%;
    max-width: 600px;
    margin: 00px auto;
    justify-content: center;
}
@media (max-width: 768px) {
    .result-buttons {
        flex-direction: column;
        gap: 10px;
    }
}

.btn-purchase {
    background: linear-gradient(to bottom, #d4af37, #aa8c2c);
    color: #000;
    padding: 18px 50px;
    border-radius: 50px;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
}
.btn-purchase:visited {
    color: #000;
}
.btn-x {
    background: #000;
    color: #fff;
    padding: 18px 50px;
    border-radius: 50px;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--text-gold);
    box-sizing: border-box;
}

#result-bottom {
    display: none;
}

#result-bottom.active {
    display: block;
    padding: 0 20px;
}
#result-bottom .btn-back {
    margin: 0 auto;
    margin-bottom: 30px;
    
}
@media (max-width: 768px) {
    #result-bottom .btn-back {
    margin-top: 24px;
    margin-bottom: 24px;
    margin-left: 0;
    
}
}
footer {
    width: 100%;
}

.footer-Copy {
    text-align: center;
    opacity: 1;
    font-size: 12px;
    letter-spacing: .04em;
    line-height: 1;
    margin-top: 1px;
    /* color: #000; */
}

@media print, screen and (max-width: 768px) {
    .footer-Copy {
        font-size: 2.34375vw;
        margin-top: 3.5104166667vw;
    }
}
