@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+JP:wght@700;900&display=swap');

:root {
    --primary: #0e0a04;          /* 深黒・墨 */
    --secondary: #b8952a;        /* 深みのある金 */
    --yellow: #d4b96a;           /* 鈍金・アンティークゴールド */
    --gold-bright: #e8c96a;      /* ハイライト金 */
    --bg-grad: linear-gradient(160deg, #070604 0%, #0e0b06 35%, #130f07 65%, #090704 100%);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Noto Serif JP', 'Hiragino Mincho ProN', 'Yu Mincho', '游明朝', serif;
    background: var(--bg-grad);
    background-attachment: fixed;
    color: #e8dfc8;
    line-height: 1.6;
    overflow-x: hidden;
}

/* PCでは最大幅500px、スマホでは100% */
.app-wrap {
    max-width: 500px;
    margin: 0 auto;
    min-height: 100vh;
    background: transparent;
    position: relative;
    padding-bottom: 40px;
    border-left: 1px solid rgba(184, 149, 42, 0.2);
    border-right: 1px solid rgba(184, 149, 42, 0.2);
}

header {
    background: linear-gradient(90deg, #030201 0%, #0e0b06 20%, #1c1608 50%, #0e0b06 80%, #030201 100%);
    color: var(--secondary);
    text-align: center;
    padding: 18px 15px;
    font-weight: bold;
    font-size: 1.2rem;
    letter-spacing: 4px;
    border-bottom: 2px solid rgba(184, 149, 42, 0.7);
    box-shadow: 0 2px 24px rgba(184, 149, 42, 0.25), 0 1px 0 rgba(232, 201, 106, 0.15) inset;
    text-shadow: 0 0 10px rgba(184, 149, 42, 0.8), 0 0 28px rgba(184, 149, 42, 0.35), 0 0 55px rgba(184, 149, 42, 0.12);
}

/* セクション共通 */
.screen { display: none; animation: fadeIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.screen.active { display: block; }
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 左右いっぱいに広がる画像 */
.full-img {
    width: 100%;
    display: block;
    object-fit: cover;
}

/* 余白を持たせるコンテンツエリア */
.content-pad {
    padding: 25px 20px;
}

/* カード */
.glass-card {
    background: linear-gradient(160deg, rgba(18, 14, 6, 0.96) 0%, rgba(12, 9, 4, 0.98) 100%);
    border-radius: 2px;
    padding: 28px 25px;
    border: 1px solid rgba(184, 149, 42, 0.45);
    border-top: 1px solid rgba(232, 201, 106, 0.35);
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.8),
        0 2px 0 rgba(232, 201, 106, 0.08) inset,
        0 -1px 0 rgba(184, 149, 42, 0.1) inset;
    margin-bottom: 25px;
    text-align: center;
    font-weight: bold;
    line-height: 1.9;
    color: #e8dfc8;
    position: relative;
}
.glass-card::before,
.glass-card::after {
    content: '🏇';
    position: absolute;
    font-size: 0.9rem;
    opacity: 0.45;
}
.glass-card::before { top: 8px; left: 12px; }
.glass-card::after  { bottom: 8px; right: 12px; transform: scaleX(-1); }

/* ボタン共通設定 */
.btn {
    display: block; width: 100%; padding: 18px; border-radius: 50px;
    font-size: 1.2rem; font-weight: bold; text-align: center; cursor: pointer;
    transition: all 0.2s; text-decoration: none; font-family: inherit;
    border: none; box-sizing: border-box;
}
.btn:active { transform: scale(0.96); }

.btn-main {
    background: linear-gradient(160deg, #1a1408 0%, #2a2010 50%, #1a1408 100%);
    color: var(--secondary);
    box-shadow:
        0 6px 24px rgba(0, 0, 0, 0.7),
        inset 0 1px 0 rgba(232, 201, 106, 0.25),
        inset 0 -1px 0 rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(184, 149, 42, 0.55);
    letter-spacing: 2px;
}

/* LINEボタン */
.btn-line {
    padding: 18px;
    width: 100%;
    display: block;
    margin: 0 auto;
    box-sizing: border-box;
    background: #06C755;
    color: #fff;
    font-size: 1.2rem;
    font-weight: bold;
    letter-spacing: 1px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(6, 199, 85, 0.25);
    transition: all 0.2s ease-out;
}

.btn-line:active {
    transform: translateY(3px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

@media (hover: hover) {
    .btn-line:hover {
        background: #05b34c;
    }
}

.btn-outline {
    background: transparent; color: var(--secondary);
    border: 1px solid rgba(184, 149, 42, 0.6);
    letter-spacing: 2px;
}

@media (hover: hover) {
    .btn-main:hover {
        background: linear-gradient(160deg, #242010 0%, #362c18 50%, #242010 100%);
        transform: translateY(-2px);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(232, 201, 106, 0.3);
    }
    .option-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
        border-color: rgba(184, 149, 42, 0.65);
        background: rgba(26, 20, 8, 0.95);
    }
}

/* 質問画面 */
.progress-bar {
    width: 100%; height: 8px; background: rgba(255, 255, 255, 0.05);
    border-radius: 10px; margin-bottom: 20px; overflow: hidden;
    border: 1px solid rgba(184, 149, 42, 0.18);
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #1a1408 0%, #6b4f1a 40%, #b8952a 75%, #e8c96a 100%);
    width: 0%;
    transition: width 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(184, 149, 42, 0.55), 0 0 20px rgba(184, 149, 42, 0.2);
}
.q-num {
    display: inline-block;
    background: rgba(184, 149, 42, 0.1);
    color: var(--secondary);
    padding: 5px 15px; border-radius: 2px; font-size: 0.95rem;
    margin-bottom: 15px; font-weight: bold;
    border: 1px solid rgba(184, 149, 42, 0.38);
    border-top: 1px solid rgba(232, 201, 106, 0.28);
    letter-spacing: 2px;
}
.q-text {
    font-size: 1.3rem; font-weight: bold; margin-bottom: 25px;
    line-height: 1.7; color: #e8dfc8; text-shadow: 0 1px 5px rgba(0, 0, 0, 0.9);
}
.options { display: flex; flex-direction: column; gap: 12px; }
.option-btn {
    background: linear-gradient(160deg, rgba(18, 14, 6, 0.9) 0%, rgba(12, 9, 4, 0.95) 100%);
    border: 1px solid rgba(184, 149, 42, 0.22);
    border-top: 1px solid rgba(232, 201, 106, 0.15);
    padding: 18px 20px;
    border-radius: 2px; font-size: 1.05rem; font-weight: bold;
    cursor: pointer; transition: all 0.15s; text-align: left;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.55); font-family: inherit; color: #e8dfc8;
}
.option-btn:active {
    background: linear-gradient(160deg, #1a1408, #2a2010);
    color: var(--secondary);
    transform: scale(0.98);
    border-color: rgba(184, 149, 42, 0.7);
}

/* 結果画面 */
.result-header {
    text-align: center; padding: 35px 20px 20px;
    background: linear-gradient(180deg, rgba(18, 14, 6, 0.3) 0%, transparent 100%);
}
.result-rank {
    display: inline-block;
    background: linear-gradient(160deg, #1a1408, #2a2010);
    color: var(--secondary);
    padding: 6px 24px; border-radius: 1px; font-size: 1rem;
    font-weight: bold; margin-bottom: 14px;
    border: 1px solid rgba(184, 149, 42, 0.5);
    border-top: 1px solid rgba(232, 201, 106, 0.35);
    letter-spacing: 3px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.6);
}
.result-title {
    font-size: 2.2rem; color: var(--secondary); font-weight: bold;
    margin-bottom: 0; line-height: 1.3;
    text-shadow:
        0 0 16px rgba(184, 149, 42, 0.7),
        0 0 35px rgba(184, 149, 42, 0.3),
        0 2px 6px rgba(0, 0, 0, 0.9);
    letter-spacing: 2px;
}
.result-desc { text-align: left; font-size: 1.1rem; color: #ddd0b0; line-height: 1.9; }

.recommend-area {
    background: linear-gradient(160deg, rgba(18, 14, 6, 0.85) 0%, rgba(10, 8, 3, 0.9) 100%);
    border: 1px solid rgba(184, 149, 42, 0.25);
    border-top: 1px solid rgba(232, 201, 106, 0.2);
    border-radius: 2px; padding: 25px 20px;
    margin-bottom: 30px;
    text-align: center; margin-top: 30px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}
.recommend-title {
    font-size: 1.2rem; margin-bottom: 15px; color: var(--secondary); letter-spacing: 3px;
    text-shadow: 0 0 10px rgba(184, 149, 42, 0.4);
}
.rounded-img { border-radius: 2px; margin-bottom: 15px; }

/* ユーティリティ */
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.ad-space { text-align: center; }

/* --- ローディング画面演出 --- */

/* ローディングコンテナ：縦並びflex、画面中央に配置 */
.loading-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    min-height: 100vh;
}

/* 「診断中」テキスト本体：通常フローに戻す */
.loading-text {
    text-align: center;
    position: relative;
    color: var(--secondary);
    font-size: 1.3rem;
    font-weight: bold;
    letter-spacing: 0.3em;
    text-shadow:
        0 0 6px rgba(184, 149, 42, 1),
        0 0 18px rgba(184, 149, 42, 0.65),
        0 0 36px rgba(184, 149, 42, 0.3),
        0 0 60px rgba(184, 149, 42, 0.12);
}

/* 馬マーク：staticにしてflexの縦並びに乗せる */
.loading-text::after {
    content: '🏇';
    position: static;
    display: block;
    font-size: 10rem;
    opacity: 0.5;
    filter: drop-shadow(0 0 24px rgba(184, 149, 42, 0.55)) sepia(0.3) saturate(0.8);
    animation: gallop 1.2s infinite ease-in-out;
}

/* 馬が駆けるような弾むアニメーション */
@keyframes gallop {
    0%   { transform: translateY(0) scale(1); }
    20%  { transform: translateY(-12px) scale(1.08); }
    40%  { transform: translateY(0) scale(1); }
    60%  { transform: translateY(-7px) scale(1.04); }
    80%  { transform: translateY(0) scale(1); }
    100% { transform: translateY(0) scale(1); }
}
