@import url('https://fonts.googleapis.com/css2?family=M+PLUS+Rounded+1c:wght=700&display=swap');

:root {
    --primary: #d48398;
    /* くすみピンクに合わせた、柔らかく上品なカラーパレットへ変更 */
    --secondary: #a3bce2; 
    --yellow: #f4d068;
    --bg-grad: linear-gradient(135deg, #fdf6f7 0%, #e8cdd5 100%);
}

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

body {
    font-family: 'M PLUS Rounded 1c', 'Hiragino Maru Gothic ProN', 'Comic Sans MS', sans-serif;
    background: var(--bg-grad);
    background-attachment: fixed; /* 背景を固定してアプリっぽく */
    color: #333;
    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;
}

header {
    background: var(--primary);
    color: #fff;
    text-align: center;
    padding: 15px;
    font-weight: bold;
    font-size: 1.2rem;
    letter-spacing: 1px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* セクション共通 */
.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: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    padding: 20px;
    /* 影の色もPrimaryに合わせて統一感を */
    box-shadow: 0 8px 25px rgba(212, 131, 152, 0.15);
    margin-bottom: 25px;
    text-align: center;
    font-weight: bold;
    line-height: 1.7;
}

/* ボタン共通設定 */
.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: var(--primary); color: #ffffff;
    box-shadow: 0 6px 15px rgba(212, 131, 152, 0.4);
}

/* Xボタンのデザインここから */

.btn-dark {
/* 1. タップ領域の最適化 (他の共通ボタンと同じサイズに統一) */
    padding: 18px;
    width: 100%;           /* 横幅いっぱいに広げます */
    display: block;
    margin: 0 auto;        /* 中央寄せ */
    box-sizing: border-box;

/* 2. 視認性と「ボタンらしさ」の向上 */
    background: #4a3b40;   /* #222からPrimaryに馴染むダークブラウン系へ変更 */
    color: #fff;
    font-size: 1.2rem;     /* 文字サイズを共通ボタンと統一 */
    font-weight: bold;     /* テキストを太くして視認性UP */
    letter-spacing: 1px;
    border: none;
    border-radius: 50px;   /* 角を丸くして心理的な押しやすさを演出 */
    cursor: pointer;

/* 3. アニメーションとトランジション */
    animation: pulse-pink 2s infinite;
    transition: all 0.2s ease-out; /* 変化を少し早めてキビキビとした反応に */
}

/* 4. スマホ向けのタップアクション (hoverではなくactiveを重視) */
.btn-dark:active {
 transform: translateY(3px); /* 上に浮くのではなく、奥に「押し込む」動き */
 box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4); /* 影を小さくして沈み込みを表現 */
 animation: none; /* タップした瞬間はパルスを止める */
}

/* PC向けの保険（PCからのアクセスもある場合） */
@media (hover: hover) {
.btn-dark:hover {
background: #5e4b52; /* 少し明るくする */
  }
}

/* 5. パルスアニメーションの微調整（色をPrimaryに統一） */
@keyframes pulse-pink {
    0% { box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3), 0 0 0 0 rgba(212, 131, 152, 0.6); }
    70% { box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3), 0 0 0 15px rgba(212, 131, 152, 0); }
    100% { box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3), 0 0 0 0 rgba(212, 131, 152, 0); }
}

/* Xボタンのデザインここまで */

.btn-outline {
    background: #fff; color: var(--primary);
    border: 2px solid var(--primary);
}

@media (hover: hover) {
    .btn-main:hover { background: #c2768a; transform: translateY(-2px); }
    .option-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 15px rgba(0,0,0,0.1); }
}

/* 質問画面 */
.progress-bar {
    width: 100%; height: 12px; background: rgba(255,255,255,0.6);
    border-radius: 10px; margin-bottom: 20px; overflow: hidden;
}
.progress-fill {
    height: 100%; background: var(--primary); width: 0%;
    transition: width 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border-radius: 10px;
}
.q-num {
    display: inline-block; background: #fff; color: var(--primary);
    padding: 5px 15px; border-radius: 20px; font-size: 0.95rem;
    margin-bottom: 15px; font-weight: bold; box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.q-text {
    font-size: 1.4rem; font-weight: bold; margin-bottom: 25px;
    line-height: 1.5; color: #333; text-shadow: 1px 1px 0px rgba(255,255,255,0.6);
}
.options { display: flex; flex-direction: column; gap: 12px; }
.option-btn {
    background: #fff; border: none; padding: 18px 20px;
    border-radius: 16px; font-size: 1.1rem; font-weight: bold;
    cursor: pointer; transition: all 0.1s; text-align: left;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06); font-family: inherit; color: #333;
}
.option-btn:active { background: var(--primary); color: white; transform: scale(0.98); }

/* 結果画面 */
.result-header { text-align: center; padding: 35px 20px 20px; }
.result-rank {
    display: inline-block; background: var(--primary); color: white;
    padding: 6px 20px; border-radius: 20px; font-size: 1rem;
    font-weight: bold; margin-bottom: 10px;
}
.result-title {
    font-size: 2.6rem; color: var(--primary); font-weight: bold;
    margin-bottom: 0; line-height: 1.2; text-shadow: 2px 2px 0px #fff;
}
.result-desc { text-align: left; font-size: 1.15rem; color: #444; }

.recommend-area {
    background: rgba(255,255,255,0.7);
    border-radius: 20px; padding: 25px 20px;
    text-align: center; margin-top: 30px;
}
.recommend-title { font-size: 1.2rem; margin-bottom: 15px; color: #333; }
.rounded-img { border-radius: 12px; margin-bottom: 15px; }

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

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

/* ローディングコンテナの基本設定 */
.loading-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 70vh;
}

/* 「診断中…」テキスト本体 */
.loading-text {
    position: fixed;
    top: 15%; /* 少し下げて画面のバランスを整える */
    left: 50%;
    transform: translateX(-50%);
    
    color: var(--primary);
    font-size: 1.2rem;
    font-weight: bold;
    letter-spacing: 0.1em;
    z-index: 10;
    
    /* 白い光彩 */
    text-shadow: 
        0 0 5px rgba(255, 255, 255, 1),
        0 0 10px rgba(255, 255, 255, 1),
        0 0 15px rgba(255, 255, 255, 0.9),
        0 0 20px rgba(255, 255, 255, 0.8);
}

/* ハート（アニメーション） */
.loading-text::before {
    content: '\2764\FE0E';
    /* 画面全体に対するfixedではなく、テキストに対する絶対配置(absolute)に変更 */
    position: absolute;
    top: 3rem; /* テキストの下に固定されるため絶対に被らない */
    left: 50%;  
    
    font-size: 14rem; 
    z-index: -1;
    color: var(--primary);
    
    background: none;
    -webkit-background-clip: unset;
    -webkit-text-fill-color: unset;
    background-clip: unset;

    animation: heartbeat-crisp 1.5s infinite ease-in-out;
}

/* リアルな心拍アニメーション */
@keyframes heartbeat-crisp {
    /* left:50%を基点にしているため、translateX(-50%)を維持しつつ拡縮させる */
    0% { transform: translateX(-50%) scale(1) translateZ(0); }
    15% { transform: translateX(-50%) scale(1.25) translateZ(0); }
    30% { transform: translateX(-50%) scale(1.05) translateZ(0); }
    45% { transform: translateX(-50%) scale(1.35) translateZ(0); }
    60% { transform: translateX(-50%) scale(1) translateZ(0); }
    100% { transform: translateX(-50%) scale(1) translateZ(0); }
}
