/**
 * サクポチ - おみくじ 専用スタイル
 * Omikuji Fortune Tool Styles
 */

/* ====================
   おみくじ箱（初期表示）
   ==================== */
.omikuji-initial {
    padding: 40px 20px;
    text-align: center;
}

.omikuji-box {
    width: 120px;
    height: 140px;
    margin: 0 auto 24px;
    perspective: 500px;
}

.omikuji-box-inner {
    width: 100%;
    height: 100%;
    background: linear-gradient(145deg, #8b4513 0%, #654321 50%, #4a2c17 100%);
    border-radius: 8px 8px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 
        0 4px 8px rgba(0, 0, 0, 0.3),
        inset 0 2px 4px rgba(255, 255, 255, 0.1);
    border: 2px solid #3d2817;
}

.omikuji-box-inner::before {
    content: '';
    position: absolute;
    top: -8px;
    left: -4px;
    right: -4px;
    height: 20px;
    background: linear-gradient(145deg, #a0522d 0%, #8b4513 100%);
    border-radius: 4px 4px 0 0;
    border: 2px solid #654321;
    border-bottom: none;
}

.omikuji-box-inner::after {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 8px;
    background: #1a1a1a;
    border-radius: 4px;
}

.omikuji-box-text {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
    color: #ffd700;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    writing-mode: vertical-rl;
    letter-spacing: 4px;
    margin-top: 16px;
}

.omikuji-instruction {
    font-size: 14px;
    color: var(--color-text-secondary);
    margin: 0;
}

/* シェイクアニメーション */
@keyframes shake {
    0%, 100% { transform: translateX(0) rotate(0deg); }
    10% { transform: translateX(-8px) rotate(-3deg); }
    20% { transform: translateX(8px) rotate(3deg); }
    30% { transform: translateX(-8px) rotate(-3deg); }
    40% { transform: translateX(8px) rotate(3deg); }
    50% { transform: translateX(-6px) rotate(-2deg); }
    60% { transform: translateX(6px) rotate(2deg); }
    70% { transform: translateX(-4px) rotate(-1deg); }
    80% { transform: translateX(4px) rotate(1deg); }
    90% { transform: translateX(-2px) rotate(0deg); }
}

.omikuji-box.shaking {
    animation: shake 0.8s ease-in-out;
}

/* ====================
   結果表示エリア
   ==================== */
.omikuji-result {
    padding: 0;
}

/* メイン運勢 */
.fortune-main {
    padding: 32px 20px;
    text-align: center;
    background: linear-gradient(180deg, var(--color-bg) 0%, var(--color-white) 100%);
    border-bottom: 1px solid var(--color-border);
}

.fortune-label {
    display: block;
    font-size: 13px;
    color: var(--color-text-muted);
    margin-bottom: 8px;
}

.fortune-value {
    font-family: var(--font-display);
    font-size: 56px;
    font-weight: 700;
    line-height: 1.2;
    display: block;
}

/* 運勢別カラー */
.fortune-value.daikichi { color: #e63946; }
.fortune-value.chukichi { color: #f4a261; }
.fortune-value.shokichi { color: #e9c46a; }
.fortune-value.kichi { color: #2a9d8f; }
.fortune-value.suekichi { color: #457b9d; }
.fortune-value.kyo { color: #6c757d; }
.fortune-value.daikyo { color: #495057; }

/* 一言アドバイス */
.fortune-message {
    padding: 20px;
    background: var(--color-white);
    border-bottom: 1px solid var(--color-border);
    text-align: center;
}

.fortune-message-text {
    font-size: 15px;
    color: var(--color-text);
    line-height: 1.8;
    margin: 0;
}

/* カテゴリ別運勢 */
.fortune-categories {
    padding: 20px;
    background: var(--color-white);
    border-bottom: 1px solid var(--color-border);
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.fortune-category {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.category-label {
    font-size: 13px;
    color: var(--color-text-muted);
}

.category-stars {
    font-size: 16px;
    color: #ffc107;
    letter-spacing: 2px;
}

.category-stars .star-empty {
    color: #e0dcd6;
}

/* ラッキー要素 */
.lucky-section {
    padding: 20px;
    background: var(--color-bg);
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.lucky-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.lucky-label {
    font-size: 12px;
    color: var(--color-text-muted);
}

.lucky-value {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 700;
    color: var(--color-text);
    display: flex;
    align-items: center;
    gap: 6px;
}

.lucky-color-chip {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1px solid var(--color-border);
    flex-shrink: 0;
}

/* ====================
   履歴カード
   ==================== */
.history-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    justify-content: center;
}

.history-item {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.history-label {
    font-size: 13px;
    color: var(--color-text-muted);
}

.history-value {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 700;
    color: var(--color-primary-dark);
}

.history-unit {
    font-size: 13px;
    color: var(--color-text-muted);
}

/* ====================
   フェードインアニメーション
   ==================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.omikuji-result.fade-in .fortune-main {
    animation: fadeInUp 0.5s ease-out forwards;
}

.omikuji-result.fade-in .fortune-message {
    animation: fadeInUp 0.5s ease-out 0.1s forwards;
    opacity: 0;
}

.omikuji-result.fade-in .fortune-categories {
    animation: fadeInUp 0.5s ease-out 0.2s forwards;
    opacity: 0;
}

.omikuji-result.fade-in .lucky-section {
    animation: fadeInUp 0.5s ease-out 0.3s forwards;
    opacity: 0;
}

/* ====================
   ボタン状態
   ==================== */
#drawOmikujiBtn {
    min-width: 160px;
    transition: all 0.2s ease;
}

#drawOmikujiBtn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

#drawOmikujiBtn.drawing {
    background: var(--color-text-muted);
}

/* ====================
   レスポンシブ対応
   ==================== */
@media (max-width: 600px) {
    .omikuji-initial {
        padding: 32px 16px;
    }

    .omikuji-box {
        width: 100px;
        height: 120px;
    }

    .omikuji-box-text {
        font-size: 16px;
    }

    .fortune-main {
        padding: 24px 16px;
    }

    .fortune-value {
        font-size: 44px;
    }

    .fortune-message {
        padding: 16px;
    }

    .fortune-message-text {
        font-size: 14px;
    }

    .fortune-categories {
        padding: 16px;
        gap: 12px;
    }

    .category-stars {
        font-size: 14px;
    }

    .lucky-section {
        padding: 16px;
        gap: 12px;
    }

    .lucky-value {
        font-size: 14px;
    }

    .history-summary {
        gap: 16px;
    }
}

/* 4カラムレイアウト（大画面） */
@media (min-width: 601px) {
    .fortune-categories {
        grid-template-columns: repeat(4, 1fr);
    }

    .lucky-section {
        grid-template-columns: repeat(4, 1fr);
    }
}
