/* 全体設定 */
body {
    background: linear-gradient(135deg, #1a0b2e 0%, #4a2b6b 100%); /* 深い紫のグラデ */
    color: #fff;
    font-family: 'Kiwi Maru', serif;
    margin: 0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.main-container {
    background: rgba(255, 255, 255, 0.1); /* ガラスっぽい半透明 */
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 90%;
    max-width: 450px;
    padding: 30px 20px;
    border-radius: 20px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
    text-align: center;
}

/* ゆうきくん画像 */
.yuuki-img-container {
    position: relative;
    width: 160px;
    height: 160px;
    margin: 0 auto;
}

.yuuki-img-container img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #ffd700;
    box-shadow: 0 0 15px #ffd700;
    transition: transform 0.3s;
}

.yuuki-img-container img:hover {
    transform: scale(1.05);
}

/* 吹き出し */
.dialogue-box {
    background: #fff;
    color: #333;
    padding: 15px;
    border-radius: 15px;
    margin-top: 20px;
    position: relative;
    font-weight: bold;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}
.dialogue-box::after {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 10px solid #fff;
}

/* メニューボタン（豪華仕様） */
.menu-btn {
    display: block;
    width: 100%;
    padding: 18px;
    margin: 15px 0;
    background: linear-gradient(90deg, #6a11cb 0%, #2575fc 100%);
    border: none;
    border-radius: 50px;
    color: white;
    font-size: 1.2rem;
    font-family: 'Zen Maru Gothic', sans-serif;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(37, 117, 252, 0.4);
    transition: all 0.3s;
}

.menu-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(37, 117, 252, 0.6);
}

.menu-btn i {
    margin-right: 10px; /* アイコンと文字の間隔 */
}

.night-only {
    background: linear-gradient(90deg, #0f2027, #203a43, #2c5364);
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}

/* 結果エリア */
.hidden { display: none; }

#card-display {
    min-height: 250px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
}
/* 画像がない時の仮表示用 */
.temp-card {
    width: 150px;
    height: 250px;
    background: #333;
    border: 2px solid gold;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 3rem;
}

/* リンクボタン */
.link-btn {
    display: inline-block;
    margin-top: 15px;
    padding: 10px 20px;
    background-color: #ff4757; /* 人狼っぽい赤 */
    color: white;
    text-decoration: none;
    border-radius: 20px;
    font-weight: bold;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.yuuki-comment-box {
    background: rgba(0,0,0,0.3);
    padding: 15px;
    border-radius: 10px;
    margin-top: 15px;
    border-left: 4px solid #ffd700;
    text-align: left;
}
.yuuki-comment-box .label {
    font-size: 0.8rem;
    color: #ffd700;
    display: block;
    margin-bottom: 5px;
}

/* タイトル */
.game-title {
    font-family: 'Zen Maru Gothic', sans-serif;
    color: #ffd700;
    text-shadow: 0 0 10px #e60073, 2px 2px 0 #000;
    margin-bottom: 20px;
    font-size: 1.8rem;
}

/* 相性結果の相手画像 */
.partner-img img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid white;
    box-shadow: 0 0 15px rgba(255,255,255,0.5);
    background: #fff;
    object-fit: cover;
}

.score-box {
    font-size: 1.5rem;
    font-weight: bold;
    margin: 15px 0;
    background: rgba(255,255,255,0.1);
    padding: 10px;
    border-radius: 10px;
}
.score-num {
    color: #ff758c;
    font-size: 2.5rem;
}

/* 相手のセリフエリア */
.partner-voice {
    background: #fffaf0; /* ちょっとクリーム色 */
    color: #444;
    text-align: left;
    margin-bottom: 10px;
}

/* --- 追加・修正分 --- */

/* 🔽 プルダウン（セレクトボックス）を豪華に */
select {
    width: 100%;
    padding: 15px;
    margin: 10px 0;
    border-radius: 25px;
    border: 2px solid #a982ff;
    background-color: rgba(255, 255, 255, 0.9);
    color: #333;
    font-family: 'Kiwi Maru', serif;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    outline: none;
    appearance: none; /* デフォルトの矢印を消す */
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236a11cb' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 20px;
}

select:hover {
    border-color: #ffd700;
}

/* 🔙 戻るボタン・リトライボタン */
.retry-btn {
    display: block;
    width: 100%;
    padding: 12px;
    margin-top: 15px;
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.5);
    color: #fff;
    border-radius: 25px;
    cursor: pointer;
    font-family: 'Zen Maru Gothic', sans-serif;
    transition: all 0.3s;
}

.retry-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: #fff;
}

/* 👤 プロフィール表示エリア（結果画面用） */
.profile-info {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 10px;
    margin: 10px 0;
    font-size: 0.9rem;
    text-align: left;
}

.profile-tag {
    display: inline-block;
    background: #6a11cb;
    color: white;
    padding: 2px 8px;
    border-radius: 5px;
    margin-right: 5px;
    font-size: 0.8rem;
}

.bio-text {
    margin-top: 5px;
    line-height: 1.4;
    font-size: 0.9rem;
}

/* 名前入力エリア */
.name-input-area {
    margin-bottom: 15px;
    background: rgba(255, 255, 255, 0.2);
    padding: 10px;
    border-radius: 15px;
}
.name-input-area label {
    font-size: 0.9em;
    display: block;
    margin-bottom: 5px;
}
.name-input-area input {
    width: 80%;
    padding: 8px;
    border-radius: 20px;
    border: none;
    text-align: center;
    font-family: 'Kiwi Maru', serif;
}

/* 共有ボタン */
.share-btn {
    background: #000;
    color: #fff;
    margin-top: 10px;
    border: 1px solid #fff;
}
.share-btn i {
    margin-right: 5px;
}

/* 運勢メーター（棒グラフ） */
.meter-box {
    text-align: left;
    margin: 10px 0;
    background: rgba(0,0,0,0.3);
    padding: 10px;
    border-radius: 10px;
}
.meter-label {
    font-size: 0.9em;
    margin-bottom: 2px;
}
.meter-bar-bg {
    width: 100%;
    height: 10px;
    background: #555;
    border-radius: 5px;
    overflow: hidden;
}
.meter-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #ffd700, #ff8c00);
    width: 0%; /* JSで動かす */
    transition: width 1s ease-out;
}

/* 🔮 水晶玉のアニメーション */
.crystal-ball-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 180px;
    margin: 20px 0;
}

.crystal-ball {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    /* 紫〜黒の怪しいグラデーション */
    background: radial-gradient(circle at 30% 30%, rgba(200, 150, 255, 0.8), #2c1e38 80%);
    /* 光沢と影 */
    box-shadow: 
        0 0 20px rgba(169, 130, 255, 0.6), /* 外側の光 */
        inset 0 0 20px rgba(255, 255, 255, 0.4), /* 内側の光沢 */
        inset -10px -20px 30px rgba(0, 0, 0, 0.8); /* 立体感 */
    position: relative;
    animation: pulseBall 3s infinite ease-in-out;
}

/* ふわふわ浮いて光る動き */
@keyframes pulseBall {
    0% { transform: translateY(0) scale(1); box-shadow: 0 0 20px rgba(169, 130, 255, 0.6); }
    50% { transform: translateY(-10px) scale(1.05); box-shadow: 0 0 40px rgba(169, 130, 255, 1); }
    100% { transform: translateY(0) scale(1); box-shadow: 0 0 20px rgba(169, 130, 255, 0.6); }
}

/* 水晶の中に文字を浮かべる */
.crystal-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-weight: bold;
    text-shadow: 0 0 5px #ff00de;
    opacity: 0;
    width: 80%;
    font-size: 0.9rem;
    pointer-events: none; /* クリック邪魔しない */
}

/* 結果が出た時のラッキーアイテム表示 */
.lucky-box {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid #a982ff;
    border-radius: 10px;
    padding: 10px;
    margin-top: 10px;
    text-align: left;
}
.lucky-label {
    color: #ffd700;
    font-size: 0.8rem;
    display: block;
}
.lucky-content {
    font-size: 1.1rem;
    font-weight: bold;
}

/* --- 🌙 深読みモード専用演出 --- */

/* 青い炎（魂の火） */
.soul-flame-container {
    height: 150px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
}

.soul-flame {
    width: 60px;
    height: 100px;
    background: linear-gradient(to bottom, rgba(135, 206, 250, 0.2), #00bfff, #fff);
    border-radius: 50% 50% 20% 20%;
    box-shadow: 
        0 0 20px #00bfff,
        0 0 40px #0000ff,
        inset 0 0 20px #fff;
    animation: flicker 3s infinite alternate;
    position: relative;
    filter: blur(2px);
}

@keyframes flicker {
    0% { transform: scale(1) skewX(2deg); opacity: 0.9; }
    25% { transform: scale(1.1) skewX(-2deg); opacity: 0.7; }
    50% { transform: scale(0.9) skewX(1deg); opacity: 1; }
    75% { transform: scale(1.05) skewX(-1deg); opacity: 0.8; }
    100% { transform: scale(1) skewX(2deg); opacity: 0.9; }
}

/* 影のキーワード（漢字ドーン！） */
.shadow-keyword {
    font-size: 3rem;
    font-family: 'Zen Maru Gothic', sans-serif;
    color: #fff;
    text-shadow: 0 0 10px #00bfff, 0 0 20px #0000ff;
    letter-spacing: 0.5em;
    margin: 10px 0;
    opacity: 0;
    animation: fadeInSlow 3s forwards;
}

@keyframes fadeInSlow {
    0% { opacity: 0; transform: translateY(10px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* 真夜中のミッション枠 */
.mission-box {
    border: 1px solid #4a2b6b;
    background: rgba(0, 0, 0, 0.6);
    color: #b197fc;
    padding: 15px;
    border-radius: 5px;
    font-size: 0.9rem;
    margin-top: 15px;
    text-align: left;
}
.mission-label {
    display: block;
    font-size: 0.7rem;
    color: #6a11cb;
    margin-bottom: 5px;
    letter-spacing: 2px;
}

/* --- 🃏 タロットカード裏面演出 --- */
.card-scene {
    perspective: 1000px; /* 奥行き */
    width: 150px;
    height: 250px;
    margin: 0 auto 20px;
}

.card-object {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.8s;
}

/* カードをめくるクラス（JSでつける） */
.is-flipped {
    transform: rotateY(180deg);
}

.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden; /* 裏側を見せない */
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(0,0,0,0.5);
}

.card-face-front {
    /* 表面（結果） */
    transform: rotateY(180deg); /* 最初は裏返しておく */
}

.card-face-back {
    /* 裏面 */
    background: #1a0b2e;
    border: 2px solid #ffd700;
    display: flex;
    justify-content: center;
    align-items: center;
}
.card-face-back img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
}

/* --- 📊 項目別運勢のアニメーション --- */
.meter-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #ffd700, #ff8c00);
    width: 0%; /* 初期値0 */
    transition: width 1.5s cubic-bezier(0.22, 1, 0.36, 1); /* グイーンと伸びる */
}

/* --- 📂 ファイル選択ボタンのカスタマイズ --- */
input[type="file"] {
    color: #fff; /* ファイル名の文字色 */
    font-size: 0.9rem;
    padding: 5px;
}

/* ボタン部分だけのデザイン */
input[type="file"]::file-selector-button {
    border: none;
    padding: 8px 15px;
    border-radius: 20px;
    background: linear-gradient(90deg, #a18cd1, #fbc2eb); /* パステル紫ピンク */
    color: #fff;
    font-weight: bold;
    font-family: 'Zen Maru Gothic', sans-serif;
    cursor: pointer;
    margin-right: 10px;
    transition: transform 0.2s;
}

input[type="file"]::file-selector-button:hover {
    transform: scale(1.05);
    opacity: 0.9;
}
/* --- 🏠 ホームへ戻るリンク --- */
.home-link-area {
    margin-top: 30px;
    margin-bottom: 10px;
}

.home-link {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.9rem;
    font-family: 'Zen Maru Gothic', sans-serif;
    transition: all 0.3s;
    border-bottom: 1px solid transparent;
}

.home-link:hover {
    color: #fff;
    border-bottom: 1px solid #fff;
    letter-spacing: 1px; /* ホバーすると文字間隔が広がる */
}

.home-link i {
    margin-right: 5px;
}

/* =========================================
   📱 スマホ・レスポンシブ対応
   （画面の幅が480px以下の時に適用される設定）
   ========================================= */
@media (max-width: 480px) {

    /* 全体：縦長の画面では上詰めにする（スクロールしやすくするため） */
    body {
        align-items: flex-start;
        padding-top: 20px;
        padding-bottom: 20px;
    }

    /* コンテナ：スマホでは横幅いっぱいに使う */
    .main-container {
        width: 95%;
        padding: 20px 15px; /* 横の余白を少し減らす */
        margin-top: 10px;
    }

    /* タイトル：少し小さくして改行を防ぐ */
    .game-title {
        font-size: 1.5rem;
        margin-bottom: 15px;
    }

    /* ゆうきくんの画像：少し小さくして圧迫感を減らす */
    .yuuki-img-container {
        width: 130px;
        height: 130px;
    }

    /* メニューボタン：文字サイズと余白を調整 */
    .menu-btn {
        padding: 15px;
        font-size: 1rem; /* スマホで読みやすいサイズ */
    }
    
    /* 補足テキスト（カッコ内の文字） */
    .menu-btn span {
        font-size: 0.75rem;
    }

    /* 入力フォームの微調整 */
    .name-input-area input {
        width: 90%;
        font-size: 1rem;
    }

    /* 🔮 水晶玉：スマホ画面からはみ出ないように少し縮小 */
    .crystal-ball-container {
        height: 150px;
    }
    .crystal-ball {
        width: 100px;
        height: 100px;
    }
    /* 水晶の中の文字サイズ */
    .crystal-text {
        font-size: 0.8rem;
    }

    /* 🃏 タロットカード：少し小さく */
    .card-scene {
        width: 120px;
        height: 200px;
    }

    /* 結果の文字サイズ */
    #result-text {
        font-size: 0.95rem;
    }
    
    /* 戻るボタンなどを押しやすく */
    .retry-btn {
        padding: 15px;
        font-size: 1rem;
    }
    
    /* 📊 グラフの文字サイズ調整 */
    .meter-label {
        font-size: 0.8rem;
    }
    
    /* 深読みの漢字キーワード */
    .shadow-keyword {
        font-size: 2.5rem;
    }
}
