/* 花守り・陰陽デイリーお告げスタイル */

#hanamori-daily-oracle-wrapper {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    font-family: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
    text-align: center;
}

.hdo-intro h2 {
    font-size: 2rem;
    color: #333;
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
}

.hdo-intro h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: linear-gradient(to right, #ff9a9e, #fad0c4);
    margin: 10px auto 0;
}

.hdo-intro p {
    font-size: 1rem;
    color: #666;
    margin-bottom: 2rem;
}

/* シングルモード用のコンテナ */
.hdo-single-mode {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    min-height: 400px;
}

#hdo-deck-container {
    perspective: 1000px;
}

/* カードスタイル共通 */
.hdo-card {
    position: relative;
    width: 300px;
    /* 基準幅を大きく変更 */
    max-width: 90vw;
    /* スマホでは画面からはみ出さないように */
    height: auto;
    /* 高さは画像に合わせる */
    cursor: pointer;
    perspective: 1000px;
    transition: transform 0.3s ease;
    margin: 0 auto;
    display: inline-block;
    /* 画像サイズにフィットさせるため */
}

.hdo-card:hover {
    transform: translateY(-5px) scale(1.05);
}

.hdo-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
    background: transparent;
    /* 背景透明 */
    box-shadow: none;
    /* コンテナの影を削除 */
}

/* 裏面（デフォルト表示） */
.hdo-card-back {
    position: relative;
    /* imgの親として配置 */
    width: 100%;
    height: auto;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* カード画像 */
.hdo-card-back-img {
    width: 100%;
    height: auto;
    display: block;
    filter: drop-shadow(0 5px 10px rgba(0, 0, 0, 0.3));
    /* 画像自体に影をつける */
    border-radius: 12px;
    /* 画像自体に角丸が必要な場合 */
}

/* クリックヒント */
.hdo-click-hint {
    position: absolute;
    /* 画像の上に配置 */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.8);
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: bold;
    color: #555;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    /* クリックを透過 */
    white-space: nowrap;
}

.hdo-card:hover .hdo-click-hint {
    opacity: 1;
}

.hdo-instruction {
    margin-top: 20px;
    font-size: 1.1rem;
    color: #444;
    font-weight: bold;
    animation: hdoPulse 2s infinite;
}

@keyframes hdoPulse {
    0% {
        opacity: 0.7;
    }

    50% {
        opacity: 1;
        transform: scale(1.05);
    }

    100% {
        opacity: 0.7;
    }
}

/* モーダル (結果表示) */
.hdo-modal {
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    /* 半透明の黒背景 */
    display: flex !important;
    /* JSでshowクラスを付け外しするが、基本はflexにしておく */
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    /* display:noneの代わりにvisibilityを使う */
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
}

.hdo-modal.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* 念のためdisplay:noneで完全に隠す初期状態を上書きできるように */
.hdo-modal[style*="display:none"] {
    display: none !important;
}


.hdo-modal-content {
    background-color: #fff;
    margin: auto;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    width: 85%;
    max-width: 500px;
    /* 少し小さく */
    max-height: 90vh;
    /* 画面からはみ出さない */
    overflow-y: auto;
    /* スクロール可能に */
    border-radius: 20px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    text-align: center;

    /* Glassmorphism強化 */
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
}

.hdo-close {
    color: #888;
    position: absolute;
    top: 10px;
    right: 15px;
    width: 36px;
    height: 36px;
    line-height: 36px;
    text-align: center;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 100;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.hdo-close:hover,
.hdo-close:focus {
    color: #333;
    background: #fff;
    transform: scale(1.1);
    text-decoration: none;
}

/* 結果コンテンツ */
.hdo-result-title {
    font-size: 1.6rem;
    margin-bottom: 15px;
    font-weight: bold;
    color: #444;
}

.hdo-result-type {
    display: inline-block;
    padding: 5px 15px;
    border-radius: 20px;
    color: #fff;
    font-weight: bold;
    margin-bottom: 15px;
    font-size: 1.4rem;
}

.hdo-type-yang {
    background: linear-gradient(135deg, #FF6B6B 0%, #FFD93D 100%);
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
}

.hdo-type-yin {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.4);
}

.hdo-god-img {
    max-width: 100%;
    max-height: 35vh;
    /* 画像を少し小さくして全体を見やすく */
    width: auto;
    height: auto;
    object-fit: contain;
    margin-bottom: 15px;
    filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.2));
    transition: transform 0.5s ease;
}

.hdo-result-msg {
    font-size: 1.25rem;
    line-height: 1.8;
    text-align: left;
    background: #f9f9f9;
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid #ddd;
}

.hdo-type-yang~.hdo-result-msg {
    border-left-color: #FF6B6B;
}

.hdo-type-yin~.hdo-result-msg {
    border-left-color: #4facfe;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hdo-result-content {
    animation: fadeIn 0.5s ease-out forwards;
}