/* ============================================================
 * fortune.css
 * fortune-slip.html / fortune-result.html 共用スタイル
 * ============================================================ */


/* ===== CSS変数（両ページ共通） ===== */
:root {
    --tako-dark: #5C2E00;
    --tako-main: #7B3F00;
    --tako-mid: #A0522D;
    --tako-light: #D2691E;
    --tako-orange: #E8750A;
    --bg-warm: #FFF8F0;
}


/* ===== ページ背景（両ページ共通） ===== */
.fortune-page {
    background-color: var(--bg-warm);
    min-height: 60vh;
}


/* ===== ヒーローバナー（両ページ共通） ===== */
.fortune-hero {
    background: linear-gradient(135deg, var(--tako-dark) 0%, var(--tako-main) 50%, var(--tako-dark) 100%);
    color: #fff;
    padding: 3rem 0 2.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.fortune-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        repeating-linear-gradient(0deg, transparent, transparent 30px, rgba(255, 255, 255, 0.03) 30px, rgba(255, 255, 255, 0.03) 31px),
        repeating-linear-gradient(90deg, transparent, transparent 30px, rgba(255, 255, 255, 0.03) 30px, rgba(255, 255, 255, 0.03) 31px);
}

.fortune-hero h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    position: relative;
}

.fortune-hero p {
    color: #f5c899;
    font-size: 0.9rem;
    position: relative;
}


/* ===== コンテナ（両ページ共通） ===== */
.omikuji-container {
    max-width: 480px;
    margin: 0 auto;
}


/* ===== ポイントバッジ・ヘッダー右上（両ページ共通） ===== */
.point-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: #fef3c7;
    color: #92400e;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.7rem;
    border: 1px solid #fde68a;
}


/* ============================================================
 * fortune-slip.html 専用
 * ============================================================ */

/* ===== 未ログインCTA ===== */
.login-cta-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    padding: 2.5rem 2rem;
    text-align: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

/* ===== 気分選択カード ===== */
.draw-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    padding: 2rem 1.75rem;
    text-align: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

/* ===== おみくじ筒 ===== */
.omikuji-tube {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 1.25rem;
}

.omikuji-tube-top {
    width: 60px;
    height: 16px;
    background: linear-gradient(135deg, var(--tako-main), var(--tako-mid));
    border-radius: 50% 50% 0 0 / 100% 100% 0 0;
    box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.1);
}

.omikuji-tube-body {
    width: 80px;
    height: 120px;
    background: linear-gradient(160deg, var(--tako-light) 0%, var(--tako-main) 40%, var(--tako-dark) 100%);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.92);
    letter-spacing: 0.2em;
    writing-mode: vertical-rl;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
    box-shadow: inset -4px 0 8px rgba(0, 0, 0, 0.15), 0 4px 12px rgba(0, 0, 0, 0.15);
    position: relative;
}

.omikuji-tube-body::after {
    content: '';
    position: absolute;
    left: 10px;
    top: 10px;
    bottom: 10px;
    width: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

/* ===== 気分選択グリッド ===== */
.mood-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.mood-option input[type="radio"] {
    display: none;
}

.mood-option label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.75rem 0.75rem;
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 0.75rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    text-align: center;
    transition: border-color 0.15s, background-color 0.15s, color 0.15s;
    min-height: 3.5rem;
}

.mood-option input[type="radio"]:checked + label {
    border-color: var(--tako-light);
    background: #FFF3E8;
    color: var(--tako-main);
}

.mood-option label:hover {
    border-color: var(--tako-light);
}

/* ===== 引くボタン ===== */
/*
 * 左半分 (0–50%): プログレス領域
 *   末尾(0%)  → 元の色
 *   先端(50%) → 最も暗い色
 *   → 左から右へ暗くなるグラデーションで「進行波」を表現
 * 右半分 (50–100%): 未達領域
 *   先端直後(50–56%) → 暗→元の色へ素早く戻る
 *   その後 → 元の色で固定
 * background-position を 100%→0% に遷移させると
 * 先端(最暗部)が左→右へ走る波のように見える
 */
.btn-draw {
    background-image: linear-gradient(to right,
        #94530A 0%,     /* 末尾: 元の色 */
        #CA8A04 20%,    /* 温かみのある茶色へ */
        #FBBF24 49%,    /* 黄金がかった茶色 */
        #FDE68A 50%,    /* 先端: 最も明るいゴールド */
        var(--tako-main) 50%,  /* ハードストップ: くっきり境界 */
        var(--tako-main) 100%  /* 未達: 元の色 */
    );
    background-size: 200% 100%;
    background-position: 100% 0; /* 初期: 右半分（通常色）を表示 */
    color: #fff;
    border: none;
    border-radius: 9999px;
    padding: 0.75rem 2.5rem;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(123, 63, 0, 0.35);
    transition: transform 0.15s, box-shadow 0.15s;
}

.btn-draw:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(123, 63, 0, 0.4);
}

.btn-draw:active:not(:disabled) {
    transform: translateY(0);
}

.btn-draw:disabled {
    cursor: not-allowed;
}

.btn-draw:disabled:not(.in-progress) {
    opacity: 0.4;
}

/* プログレス開始: 右から左へスライドして明るい色が左→右に広がる */
.btn-draw.in-progress {
    transition: background-position 3.8s linear;
    background-position: 0% 0;
}

/* ===== シェイクアニメーション ===== */
@keyframes shake {
    0%, 100% { transform: rotate(0deg); }
    15%       { transform: rotate(-12deg); }
    30%       { transform: rotate(12deg); }
    45%       { transform: rotate(-9deg); }
    60%       { transform: rotate(9deg); }
    75%       { transform: rotate(-5deg); }
    90%       { transform: rotate(5deg); }
}

.omikuji-tube.shaking {
    animation: shake 0.7s ease-in-out 3;
}

/* ===== おみくじ紙が出てくるアニメーション ===== */
.slip-peek {
    width: 22px;
    height: 0;
    background: #fffdf5;
    border: 1px solid #d4b896;
    border-bottom: none;
    border-radius: 3px 3px 0 0;
    margin-bottom: -1px;
    overflow: hidden;
    transition: height 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.revealing .slip-peek {
    height: 48px;
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateY(-6px);
    }
}

.submitting .omikuji-tube-body,
.submitting .omikuji-tube-top,
.submitting .slip-peek {
    animation: fadeOut 0.4s ease forwards;
}


/* ============================================================
 * fortune-result.html 専用
 * ============================================================ */

/* ===== 結果カード ===== */
.result-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    padding: 2rem 1.75rem;
    text-align: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

/* ===== おみくじ紙（縦長） ===== */
.omikuji-slip {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 90px;
    min-height: 140px;
    border-radius: 6px 6px 40% 40% / 6px 6px 20px 20px;
    padding: 1rem 0.5rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    position: relative;
}

.omikuji-slip::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 4px;
    border-radius: 2px;
    background: rgba(0, 0, 0, 0.15);
}

/* ===== ランク別スタイル ===== */
.rank-daikichi {
    background: linear-gradient(160deg, #ffe066 0%, #f5c800 50%, #e6a800 100%);
    color: #7a3800;
    border: 2px solid #e6a800;
}

.rank-daikichi .rank-label { color: #7a3800; }

.rank-chukichi {
    background: linear-gradient(160deg, #ffb347 0%, #e8750a 50%, #c85e00 100%);
    color: #fff;
    border: 2px solid #c85e00;
}

.rank-chukichi .rank-label { color: #fff; }

.rank-shokichi {
    background: linear-gradient(160deg, #ffd9a0 0%, #e8a56a 50%, #c47c3a 100%);
    color: #5c2e00;
    border: 2px solid #c47c3a;
}

.rank-shokichi .rank-label { color: #5c2e00; }

.rank-suekichi {
    background: linear-gradient(160deg, #a8d8b9 0%, #56ab8a 50%, #2e7d5e 100%);
    color: #fff;
    border: 2px solid #2e7d5e;
}

.rank-suekichi .rank-label { color: #fff; }

.rank-kyo {
    background: linear-gradient(160deg, #8c8c8c 0%, #555 50%, #333 100%);
    color: #fff;
    border: 2px solid #333;
}

.rank-kyo .rank-label { color: #fff; }

.rank-label {
    font-size: 2.2rem;
    font-weight: 900;
    letter-spacing: 0.05em;
    line-height: 1;
    margin-top: 0.5rem;
}

.rank-sub {
    font-size: 0.7rem;
    opacity: 0.8;
    margin-top: 0.4rem;
    font-weight: 600;
}

/* ===== ランク付与ポイントバッジ ===== */
.point-award {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: #fef3c7;
    color: #92400e;
    border-radius: 9999px;
    font-size: 0.9rem;
    font-weight: 700;
    padding: 0.35rem 1rem;
    border: 1px solid #fde68a;
    margin-bottom: 1rem;
}

/* ===== おすすめスポットカード ===== */
.spot-recommend-card {
    background: var(--bg-warm);
    border: 1px solid #e8d5c0;
    border-radius: 0.875rem;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    display: block;
    transition: box-shadow 0.15s, transform 0.15s;
    text-align: left;
}

.spot-recommend-card:hover {
    box-shadow: 0 6px 20px rgba(123, 63, 0, 0.15);
    transform: translateY(-2px);
    color: inherit;
}

.spot-recommend-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

.spot-recommend-body {
    padding: 0.875rem 1rem;
}

.spot-recommend-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--tako-dark);
    margin-bottom: 0.25rem;
}

.spot-recommend-category {
    font-size: 0.8rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

/* ===== 戻るボタン ===== */
.btn-back {
    background: transparent;
    color: var(--tako-main);
    border: 2px solid var(--tako-light);
    border-radius: 9999px;
    padding: 0.6rem 2rem;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.15s, color 0.15s;
    display: inline-block;
}

.btn-back:hover {
    background: var(--tako-main);
    color: #fff;
    border-color: var(--tako-main);
}

/* ===== お気に入りボーナスバナー ===== */
.favorite-bonus-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    background: #fff8ee;
    border: 1.5px dashed var(--tako-light);
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1.25rem;
}

.favorite-bonus-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--tako-dark);
    line-height: 1.4;
}

.favorite-bonus-pt {
    color: var(--tako-orange);
}

.btn-favorite-add {
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--tako-main), var(--tako-light));
    color: #fff;
    border: none;
    border-radius: 9999px;
    padding: 0.45rem 1.1rem;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(123, 63, 0, 0.3);
    transition: transform 0.12s, box-shadow 0.12s;
    white-space: nowrap;
}

.btn-favorite-add:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(123, 63, 0, 0.4);
}

/* ===== お気に入り済みバッジ ===== */
.favorited-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #f0fdf4;
    border: 1.5px solid #86efac;
    border-radius: 0.75rem;
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #166534;
    margin-bottom: 1.25rem;
}

/* ===== 翌日案内テキスト ===== */
.next-draw-note {
    font-size: 0.8rem;
    color: #9ca3af;
}
