* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: #1f1008;
    font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", sans-serif;
    background-color: #07142d;
}

.tarot-menu-page {
    min-height: 100vh;
    padding: 16px;
    background-color: #07142d;
    background-image: url("../images/menu/menu-stage1-space-bg.png");
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
}

.tarot-menu-panel {
    position: relative;
    isolation: isolate;
    width: min(100%, 1260px);
    margin: 0 auto;
    padding: 62px 30px 64px;
    text-align: center;
    background-color: #fffdf7;
    background-image:
        linear-gradient(rgba(255, 253, 247, 0.78), rgba(255, 250, 238, 0.78)),
        url("../images/menu/menu-stage1-parchment.png");
    background-position: center;
    background-size: cover;
    border: none;
    border-radius: 18px;
    box-shadow: 0 10px 24px rgba(20, 15, 8, 0.34);
}

/* 9スライス一体型フレーム */
.tarot-menu-panel::before {
    position: absolute;
    z-index: 0;
    inset: -16px;
    box-sizing: border-box;
    border: 39px solid transparent;
    border-image-source: url("../images/menu/menu-panel-frame-9slice-pc.png");
    border-image-slice: 155 155 155 155;
    border-image-width: 39px;
    border-image-repeat: stretch;
    border-radius: 18px;
    content: "";
    filter: saturate(1.08) contrast(1.06);
    pointer-events: none;
}

/* 上部中央の太陽紋章 */
.tarot-menu-panel::after {
    position: absolute;
    z-index: 1;
    top: 14px;
    left: 50%;
    width: 48px;
    height: 48px;
    background-image: url("../images/menu/menu-brand-sun-emblem.png");
    background-image: -webkit-image-set(
        url("../images/menu/menu-brand-sun-emblem.webp") 1x,
        url("../images/menu/menu-brand-sun-emblem.png") 1x
    );
    background-image: image-set(
        url("../images/menu/menu-brand-sun-emblem.webp") type("image/webp") 1x,
        url("../images/menu/menu-brand-sun-emblem.png") type("image/png") 1x
    );
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    content: "";
    filter: drop-shadow(0 1px 0 rgba(255, 244, 205, 0.18));
    pointer-events: none;
    transform: translateX(-50%);
}

.menu-kicker {
    position: relative;
    z-index: 1;
    display: flex;
    margin: 2px 0 10px;
    align-items: center;
    justify-content: center;
    gap: 14px;
    color: #804003;
    font-size: 0.82rem;
    font-weight: bold;
    letter-spacing: 0.22em;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
}

.menu-kicker::before,
.menu-kicker::after {
    display: block;
    width: clamp(34px, 7vw, 62px);
    height: 9px;
    flex: 0 1 clamp(34px, 7vw, 62px);
    background:
        radial-gradient(circle, #9f5608 0 1.35px, transparent 1.55px) left center / 8px 8px no-repeat,
        radial-gradient(circle, #bf7818 0 1px, transparent 1.2px) 11px center / 7px 7px no-repeat,
        linear-gradient(90deg, #c58f2b 0%, #9f5608 48%, #c58f2b 100%) center / calc(100% - 28px) 1px no-repeat,
        radial-gradient(circle, #bf7818 0 1px, transparent 1.2px) calc(100% - 18px) center / 7px 7px no-repeat,
        radial-gradient(circle, #9f5608 0 1.35px, transparent 1.55px) right center / 8px 8px no-repeat;
    content: "";
}

/* タイトル画像 */
#page-title {
    position: relative;
    z-index: 1;
    display: block;
    width: min(100%, 720px);
    aspect-ratio: 2508 / 627;
    margin: 0 auto;
    padding: 0;
    overflow: hidden;
    color: transparent;
    font-size: 0;
    line-height: 0;
    text-indent: -9999px;
    white-space: nowrap;
    user-select: none;
    background-image: url("../images/menu/menu-title-plate-gold.png");
    background-image: -webkit-image-set(
        url("../images/menu/menu-title-plate-gold.webp") 1x,
        url("../images/menu/menu-title-plate-gold.png") 1x
    );
    background-image: image-set(
        url("../images/menu/menu-title-plate-gold.webp") type("image/webp") 1x,
        url("../images/menu/menu-title-plate-gold.png") type("image/png") 1x
    );
    background-repeat: no-repeat;
    background-position: center;
    background-size: 100% 100%;
    border: none;
    box-shadow: none;
    text-shadow: none;
}

#page-title::before,
#page-title::after {
    display: none;
    content: none;
}

.menu-lead {
    position: relative;
    z-index: 1;
    margin: 20px 0 24px;
    color: #221108;
    font-weight: 500;
    line-height: 1.85;
}

.menu-lead-first,
.menu-lead-second {
    display: block;
}

.menu-lead-second--sp {
    display: none;
}

.menu-lead-keep {
    white-space: nowrap;
}

.menu-choice {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.menu-card {
    position: relative;
    display: flex;
    min-height: 378px;
    padding: 22px 18px 18px;
    flex-direction: column;
    text-align: left;
    background-color: #fffaf0;
    border: 1px solid #dfb754;
    border-radius: 14px;
    box-shadow: 0 4px 10px rgba(72, 48, 20, 0.05);
}

.menu-card::before {
    position: absolute;
    inset: 5px;
    border: 1px solid rgba(211, 166, 59, 0.32);
    border-radius: 10px;
    content: "";
    pointer-events: none;
}

.menu-card-heading {
    position: relative;
    padding-bottom: 16px;
    text-align: center;
    border-bottom: none;
}

.menu-card-heading::before {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 1px;
    background: linear-gradient(
        90deg,
        rgba(225, 191, 98, 0.55) 0%,
        #d4a13f 18%,
        #e6c56d 50%,
        #d4a13f 82%,
        rgba(225, 191, 98, 0.55) 100%
    );
    content: "";
}

.menu-card-heading::after {
    position: absolute;
    z-index: 1;
    bottom: -3px;
    left: 50%;
    width: 6px;
    height: 6px;
    background: #d9a442;
    border: 1px solid #fff8e8;
    box-shadow: 0 0 0 1px rgba(169, 111, 24, 0.38);
    content: "";
    transform: translateX(-50%) rotate(45deg);
}

.menu-card-count {
    margin: 0 0 8px;
    color: #804003;
    font-size: 0.78rem;
    font-weight: bold;
    letter-spacing: 0.18em;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}

.menu-card h2 {
    margin: 0;
    color: #130903;
    font-size: clamp(1.15rem, 2.1vw, 1.42rem);
    text-align: center;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.22);
}

.menu-card-description {
    min-height: 76px;
    margin: 16px 0 18px;
    color: #241107;
    font-weight: 500;
    line-height: 1.82;
}

.hexagram-description--sp {
    display: none;
}

.menu-card-label {
    margin: 0 0 12px;
    color: #231006;
    font-size: 0.92rem;
    font-weight: bold;
    text-align: center;
}

/* テーマ一覧 */
.theme-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 18px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.theme-list li {
    display: inline-flex;
    min-height: auto;
    padding: 0;
    align-items: center;
    justify-content: flex-start;
    color: #241107;
    font-size: 0.96rem;
    font-weight: 500;
    line-height: 1.45;
    white-space: nowrap;
    background: none;
    border: none;
    border-radius: 0;
    box-shadow: none;
    text-shadow: none;
    transition: none;
}

.theme-list li::before {
    content: "◆";
    margin-right: 0.42em;
    color: #d4a13f;
    font-size: 0.78em;
    line-height: 1;
    transform: translateY(-0.02em);
}

.theme-list li:hover {
    border: none;
    box-shadow: none;
    transform: none;
}

/* スリーカード・ヘキサグラム */
.theme-list:not(.theme-list--four) {
    display: grid;
    grid-template-columns: repeat(3, max-content);
    justify-content: center;
    justify-items: start;
    gap: 10px 20px;
    width: auto;
    margin: 0 auto;
}

.theme-list:not(.theme-list--four) li {
    min-width: 0;
}

/* ワンオラクル */
.theme-list--four {
    display: grid;
    grid-template-columns: max-content max-content;
    justify-content: center;
    justify-items: start;
    align-items: start;
    gap: 10px 20px;
    width: auto;
    margin: 0 auto;
}

.theme-list--four li {
    width: auto;
}

/* 開始ボタン */
.menu-start-button,
.menu-start-button:visited {
    display: flex;
    width: 100%;
    min-height: 52px;
    margin-top: auto;
    padding: 10px 16px;
    align-items: center;
    justify-content: center;
    color: #241206;
    font-size: 1.12rem;
    font-weight: bold;
    text-decoration: none;
    background:
        linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.36) 0%,
            rgba(255, 255, 255, 0.14) 18%,
            rgba(255, 255, 255, 0) 44%
        ),
        linear-gradient(
            180deg,
            #ffd98f 0%,
            #f6a63b 44%,
            #dd7d1a 100%
        );
    border: 2px solid #7a421b;
    border-radius: 10px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.88),
        inset 0 -2px 0 rgba(128, 69, 29, 0.18),
        0 4px 0 #99552a;
    text-shadow: 0 1px 0 rgba(255, 248, 236, 0.55);
    transition: transform 0.2s, box-shadow 0.2s;
}

.menu-start-button:hover {
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.92),
        inset 0 -2px 0 rgba(128, 69, 29, 0.18),
        0 6px 0 #99552a;
    transform: translateY(-2px);
}

.menu-start-button:active {
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.72),
        inset 0 -2px 0 rgba(128, 69, 29, 0.2),
        0 1px 0 #99552a;
    transform: translateY(2px);
}

.menu-start-button:focus-visible {
    outline: 3px solid #4b7d9e;
    outline-offset: 3px;
}

.menu-note {
    position: relative;
    z-index: 1;
    margin: 18px 0 0;
    line-height: 1.75;
}

/*
PC版だけ：
テーマの位置は変えず、カード高さを24px増やす。
開始ボタン3つだけが同じ高さのまま下がる。
*/
@media (min-width: 961px) {
    #page-title {
        width: min(100%, 540px);
    }

    .menu-card {
        min-height: 402px;
    }

    .menu-start-button {
        width: min(76%, 290px);
        min-height: 46px;
        align-self: center;
        font-size: 1rem;
    }
}

@media (max-width: 960px) {
    .menu-choice {
        grid-template-columns: 1fr;
    }

    .menu-card {
        min-height: 0;
    }

    .menu-card-description {
        min-height: 0;
    }

    .menu-start-button {
        margin-top: 22px;
    }
}

@media (max-width: 600px) {
    .tarot-menu-page {
        padding: 10px;
        background-image: none;
        background-color: #07142d;
    }

    .tarot-menu-panel {
        padding: 52px 18px 60px;
    }

    .tarot-menu-panel::before {
        inset: -8px;
        border-width: 24px;
        border-image-source: url("../images/menu/menu-panel-frame-9slice-sp.png");
        border-image-slice: 110 110 110 110;
        border-image-width: 24px;
        border-image-repeat: stretch;
    }

    .tarot-menu-panel::after {
        top: 14px;
        width: 38px;
        height: 38px;
    }

    .menu-kicker {
        gap: 9px;
        font-size: 0.72rem;
    }

    .menu-kicker::before,
    .menu-kicker::after {
        width: clamp(25px, 8vw, 31px);
        flex-basis: clamp(25px, 8vw, 31px);
    }

    #page-title {
        width: calc(100% + 24px);
        max-width: none;
        margin-right: -12px;
        margin-left: -12px;
    }

    .menu-lead {
        width: min(100%, 31em);
        margin: 18px auto 22px;
        padding: 0 4px;
        color: #221108;
        font-size: 0.92rem;
        font-weight: 500;
        line-height: 1.9;
        text-align: left;
    }

    .menu-lead-second--pc {
        display: none;
    }

    .menu-lead-second--sp {
        display: block;
    }

    .hexagram-description--pc {
        display: none;
    }

    .hexagram-description--sp {
        display: inline;
    }

    .menu-card {
        padding: 20px 16px 16px;
    }

    .menu-card-description {
        color: #241107;
        font-size: 1rem;
    }

    .menu-card-label {
        color: #231006;
        font-size: 1rem;
    }

    .theme-list {
        gap: 10px 14px;
    }

    .theme-list li {
        color: #241107;
        font-size: 1rem;
    }

    .theme-list--four {
        gap: 10px 20px;
    }

    .theme-list:not(.theme-list--four) {
        grid-template-columns: repeat(3, max-content);
        gap: 10px 14px;
    }

    .menu-start-button {
        width: min(82%, 260px);
        min-height: 50px;
        align-self: center;
        font-size: 1.06rem;
    }

    .menu-note {
        font-size: 0.88rem;
    }
}

/* ========================================
   デスクトップ版のみ：文字サイズ調整
   スマホ版には影響しない
======================================== */
@media (min-width: 961px) {
    /* タイトル下の案内文 */
    .menu-lead {
        font-size: 1.08rem;
    }

    /* CARD数表記 */
    .menu-card-count {
        font-size: 0.84rem;
    }

    /* ワンオラクル／スリーカード／ヘキサグラム */
    .menu-card h2 {
        font-size: 1.55rem;
    }

    /* 各カードの説明文 */
    .menu-card-description {
        font-size: 1.07rem;
        line-height: 1.84;
    }

    /* 選べるテーマ */
    .menu-card-label {
        font-size: 1rem;
    }

    /* 本日の運勢・総合運など */
    .theme-list li {
        font-size: 1rem;
    }
}