/**
 * タロット占いアプリ - スタイルシート
 * ファイル: css/tarot.css
 */
:root {
    --primary-color: #6B5B95;
    --secondary-color: #FFB347;
    --accent-color: #FF6B6B;
    --bg-gradient-1: #1a1a2e;
    --bg-gradient-2: #16213e;
    --bg-gradient-3: #0f3460;
    --card-gold: #d4af37;
    --card-purple: #9b59b6;
    --text-light: #f5f5f5;
    --text-gold: #ffd700;
    --mystical-glow: rgba(155, 89, 182, 0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* タップ時の青いハイライトを無効化 */
button, a, .spread-card, .game-card, .topic-card, .lang-btn, .audio-btn, [role="button"],
.tarot-card, .card-detail-image, .card-tap-hint, .deck-stack, .install-btn,
.start-btn, .back-button, .cards-ready-button, .triviaToggleBtn,
.result-card, .result-card-hint {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

body {
    font-family: 'Zen Maru Gothic', 'Quicksand', sans-serif;
    background: linear-gradient(135deg, var(--bg-gradient-1) 0%, var(--bg-gradient-2) 50%, var(--bg-gradient-3) 100%);
    min-height: 100vh;
    min-height: 100dvh; /* Dynamic viewport height - アドレスバー対応 */
    overflow-x: hidden;
    color: var(--text-light);
    /* iOS SafeArea対応 */
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
}

/* ========================================
   回転促し画面 (Rotation Prompt)
   ======================================== */
.rotation-prompt {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #2d1b4e 0%, #1a1a2e 50%, #0d0d1a 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.8s ease-out;
}

.rotation-prompt.hidden {
    opacity: 0;
    pointer-events: none;
}

.rotation-character {
    width: 200px;
    height: 250px;
    margin-bottom: 30px;
    animation: float 3s ease-in-out infinite;
    position: relative;
}

/* 仮キャラクター (プレースホルダー) */
.placeholder-character {
    width: 100%;
    height: 100%;
    background: linear-gradient(145deg, #9b59b6, #6b5b95);
    border-radius: 50% 50% 45% 45%;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 10px 40px rgba(155, 89, 182, 0.4);
}

.placeholder-character::before {
    content: '🔮';
    font-size: 80px;
}

.placeholder-character::after {
    content: '';
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 30px;
    background: var(--card-gold);
    border-radius: 50% 50% 0 0;
    box-shadow: 0 -5px 20px rgba(212, 175, 55, 0.5);
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(-2deg); }
    50% { transform: translateY(-15px) rotate(2deg); }
}

.rotation-message {
    text-align: center;
    padding: 0 20px;
}

.rotation-message h2 {
    font-size: 1.8rem;
    color: var(--text-gold);
    margin-bottom: 15px;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.rotation-message p {
    font-size: 1.1rem;
    color: var(--text-light);
    opacity: 0.9;
    line-height: 1.8;
}

.phone-rotate-icon {
    width: 80px;
    height: 120px;
    margin: 30px 0;
    position: relative;
    animation: rotatePhone 2s ease-in-out infinite;
}

.phone-body {
    width: 60px;
    height: 100px;
    border: 3px solid var(--text-gold);
    border-radius: 10px;
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(255, 215, 0, 0.1);
}

.phone-body::after {
    content: '';
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    background: var(--text-gold);
    border-radius: 2px;
}

@keyframes rotatePhone {
    0%, 20% { transform: rotate(0deg); }
    50%, 70% { transform: rotate(90deg); }
    100% { transform: rotate(0deg); }
}

.sparkles {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.sparkle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: var(--text-gold);
    border-radius: 50%;
    animation: sparkle 2s ease-in-out infinite;
}

@keyframes sparkle {
    0%, 100% { opacity: 0; transform: scale(0); }
    50% { opacity: 1; transform: scale(1); }
}

/* ========================================
   メイン画面 (Main Container)
   ======================================== */
.main-container {
    min-height: 100vh;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0;
    transition: opacity 0.8s ease-in;
}

.main-container.visible {
    opacity: 1;
}

/* 星空背景 */
.stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.star {
    position: absolute;
    background: white;
    border-radius: 50%;
    animation: twinkle 3s ease-in-out infinite;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

/* 流れ星 */
.shooting-star {
    position: absolute;
    width: 3px;
    height: 3px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 0 6px 2px rgba(255, 255, 255, 0.8);
    animation: shootingStar 1.2s ease-out forwards;
}

.shooting-star::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 4px;
    width: 80px;
    height: 1px;
    background: linear-gradient(to left, rgba(255, 255, 255, 0.8), transparent);
    transform: translateY(-50%);
}

@keyframes shootingStar {
    0% {
        transform: translate(0, 0);
        opacity: 1;
    }
    100% {
        transform: translate(250px, 250px);
        opacity: 0;
    }
}

/* ヘッダー */
.header {
    text-align: center;
    margin-bottom: 40px;
    z-index: 1;
    position: relative;
    padding-top: 10px;
    transition: opacity 0.8s ease, transform 0.8s ease;
}

/* ヘッダーフェードアウト（占い開始時） */
.header.fade-out {
    opacity: 0;
    transform: translateY(-20px);
    pointer-events: none;
}

.header-subtitle {
    font-size: 1rem;
    color: #e8d5a3;
    margin-bottom: 5px;
    animation: subtitleGlow 3s ease-in-out infinite;
    text-shadow: 0 0 10px rgba(232, 213, 163, 0.3);
}

@keyframes subtitleGlow {
    0%, 100% { 
        opacity: 0.85;
        text-shadow: 0 0 10px rgba(232, 213, 163, 0.3);
    }
    50% { 
        opacity: 1;
        text-shadow: 0 0 20px rgba(232, 213, 163, 0.6), 0 0 30px rgba(212, 175, 55, 0.3);
    }
}

.header h1 {
    font-size: 2.2rem;
    color: #d4af37;
    margin-bottom: 10px;
    animation: titleGlow 3s ease-in-out infinite;
    text-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
}

@keyframes titleGlow {
    0%, 100% { 
        text-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
    }
    50% { 
        text-shadow: 0 0 25px rgba(212, 175, 55, 0.7), 0 0 40px rgba(255, 215, 0, 0.4);
    }
}

.header p {
    font-size: 1rem;
    opacity: 0.8;
    color: #b8a9c9;
}

/* ========================================
   アーリーアクセスバナー
   ======================================== */
.early-access-banner {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #ff6b6b, #feca57);
    padding: 8px 20px;
    border-radius: 25px;
    margin-bottom: 20px;
    animation: bannerPulse 2s ease-in-out infinite;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

@keyframes bannerPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 6px 20px rgba(255, 107, 107, 0.5);
    }
}

.early-access-icon {
    font-size: 1.2rem;
}

.early-access-text {
    font-size: 0.9rem;
    font-weight: bold;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    letter-spacing: 1px;
}

/* ========================================
   注意事項ボックス
   ======================================== */
.disclaimer-box {
    background: rgba(26, 26, 46, 0.6);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 12px;
    padding: 15px 20px;
    margin: 0 auto 30px auto;
    max-width: 600px;
    width: 90%;
    text-align: center;
}

.disclaimer-title {
    font-size: 0.95rem;
    color: var(--text-gold);
    margin-bottom: 10px;
    font-weight: bold;
}

.disclaimer-text {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.7;
    text-align: center;
}

/* オープニング画面用の調整 */
.opening-early-access {
    margin-top: 30px;
    margin-bottom: 15px;
}

.opening-disclaimer {
    margin: 0 auto;
}

/* ========================================
   バージョン表示
   ======================================== */
.app-version {
    position: fixed;
    bottom: 10px;
    right: 15px;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.3);
    z-index: 1;
    pointer-events: none;
}

/* ========================================
   スプレッド選択メニュー
   ======================================== */
.spread-menu {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    max-width: 800px;
    width: 100%;
    z-index: 1;
    position: relative;
}

.spread-card {
    background: linear-gradient(145deg, rgba(107, 91, 149, 0.3), rgba(26, 26, 46, 0.8));
    border: 2px solid rgba(212, 175, 55, 0.3);
    border-radius: 20px;
    padding: 30px 20px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.spread-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, transparent, rgba(212, 175, 55, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.spread-card:hover {
    transform: translateY(-10px) scale(1.02);
    border-color: var(--card-gold);
    box-shadow: 0 20px 40px rgba(212, 175, 55, 0.2),
                0 0 60px rgba(155, 89, 182, 0.3);
}

.spread-card:hover::before {
    opacity: 1;
}

.spread-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    display: block;
}

.spread-card h3 {
    font-size: 1.3rem;
    color: var(--text-gold);
    margin-bottom: 10px;
}

.spread-card p {
    font-size: 0.9rem;
    opacity: 0.7;
    line-height: 1.6;
}

.card-count {
    display: inline-block;
    background: linear-gradient(135deg, var(--card-purple), var(--primary-color));
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    margin-top: 15px;
    color: white;
}

/* 準備中オーバーレイ（お店の看板風） */
.spread-card[disabled] {
    pointer-events: none;
    cursor: not-allowed;
}

.spread-card[disabled]::before {
    background: rgba(0, 0, 0, 0.6);
}

.spread-card[disabled] .spread-icon,
.spread-card[disabled] h3,
.spread-card[disabled] p,
.spread-card[disabled] .card-count {
    opacity: 0.4;
}

.coming-soon-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-15deg);
    z-index: 10;
    background: linear-gradient(135deg, #8B4513, #A0522D);
    padding: 12px 30px;
    border-radius: 8px;
    border: 3px solid #D2691E;
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}

.coming-soon-text {
    font-family: serif;
    font-size: 1.1rem;
    font-weight: bold;
    color: #FFF8DC;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    letter-spacing: 2px;
}

/* 看板の釘穴風の装飾 */
.coming-soon-overlay::before,
.coming-soon-overlay::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    background: radial-gradient(circle, #333 30%, #666 70%);
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.3);
}

.coming-soon-overlay::before {
    left: 8px;
}

.coming-soon-overlay::after {
    right: 8px;
}

/* ミニゲーム区切り線 */
.spread-menu-divider {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 10px 0 0;
}

.divider-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.4), transparent);
}

.divider-label {
    font-size: 0.85rem;
    color: rgba(212, 175, 55, 0.7);
    letter-spacing: 2px;
    white-space: nowrap;
}

/* ゲームカード */
.spread-card.game-card {
    grid-column: 1 / -1;
    background: linear-gradient(145deg, rgba(46, 139, 130, 0.25), rgba(26, 26, 46, 0.8));
    border-color: rgba(72, 201, 176, 0.3);
}

.spread-card.game-card:hover {
    border-color: #48c9b0;
    box-shadow: 0 20px 40px rgba(72, 201, 176, 0.2),
                0 0 60px rgba(72, 201, 176, 0.15);
}

.spread-card.game-card h3 {
    color: #48c9b0;
}

.game-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, #48c9b0, #2e8b82);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 10px;
    letter-spacing: 1.5px;
    z-index: 2;
}

.card-count.game-count {
    background: linear-gradient(135deg, #2e8b82, #48c9b0);
}

/* ========================================
   占い画面 (Reading Area)
   ======================================== */
.reading-area {
    display: none;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 1200px;
    z-index: 1;
    position: relative;
    transition: transform 0.8s ease-out;
}

.reading-area.active {
    display: flex;
}

/* カード確認演出時に上にスライド */
.reading-area.cards-slide-up {
    transform: translateY(-120px);
}

.back-button {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-light);
    padding: 10px 25px;
    border-radius: 25px;
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
    margin-bottom: 30px;
    transition: all 0.3s, opacity 0.5s ease, visibility 0.5s ease;
}

.back-button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(-5px);
}

/* 戻るボタンのフェードアウト */
.back-button.fade-out {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* 占い画面の戻るボタン（中央配置・カードの下） */
.reading-back-btn {
    align-self: center;
    margin-top: 25px;
    margin-bottom: 20px;
}

/* 質問選択画面の戻るボタン（グリッドの下） */
.topic-back-btn {
    align-self: center;
    margin-top: 25px;
    margin-bottom: 20px;
}

.reading-back-btn:hover,
.topic-back-btn:hover {
    transform: translateY(-2px);
}

.reading-title {
    text-align: center;
    margin-bottom: 15px;
    transition: opacity 0.8s ease, transform 0.8s ease, margin 0.6s ease, font-size 0.6s ease;
    position: relative;
    overflow: visible;
}

/* タイトルコンパクトモード（カード配り時） */
.reading-title.compact {
    margin-bottom: 5px;
    margin-top: -10px;
}

.reading-title.compact h2 {
    font-size: 1.3rem;
}

.reading-title.compact .reading-instruction {
    font-size: 0.85rem;
    margin-bottom: 5px;
}

/* タイトルフェードアウト（カード確認演出時） */
.reading-title.fade-out {
    opacity: 0;
    transform: translateY(-20px);
}

.reading-title h2 {
    font-size: 1.8rem;
    color: var(--text-gold);
    margin-bottom: 10px;
    transition: font-size 0.6s ease;
}

.reading-instruction {
    font-size: 1rem;
    opacity: 0.8;
    transition: font-size 0.6s ease, margin 0.6s ease;
    position: relative;
}

/* ガイドメッセージのフェードイン＋キラキラ演出 */
.reading-instruction.guide-animate {
    animation: guideMessageFadeIn 1.2s ease-out forwards;
}

/* ガイドメッセージのフェードアウト */
.reading-instruction.guide-fade-out {
    animation: guideMessageFadeOut 0.5s ease-out forwards;
}

@keyframes guideMessageFadeOut {
    0% {
        opacity: 0.8;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(-10px);
    }
}

@keyframes guideMessageFadeIn {
    0% {
        opacity: 0;
        transform: translateY(10px);
        filter: blur(4px);
    }
    50% {
        opacity: 0.6;
        filter: blur(0px);
    }
    100% {
        opacity: 0.8;
        transform: translateY(0);
        filter: blur(0px);
    }
}

/* キラキラエフェクト */
.guide-sparkle {
    position: absolute;
    width: 12px;
    height: 12px;
    pointer-events: none;
    z-index: 100;
    opacity: 0;
}

.guide-sparkle::before,
.guide-sparkle::after {
    content: '';
    position: absolute;
    background: linear-gradient(45deg, #ffd700, #fffacd);
    box-shadow: 0 0 4px #ffd700, 0 0 8px #ffd700;
}

.guide-sparkle::before {
    width: 100%;
    height: 3px;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    border-radius: 2px;
}

.guide-sparkle::after {
    width: 3px;
    height: 100%;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
    border-radius: 2px;
}

.guide-sparkle.animate {
    animation: guideSparkle 1s ease-out forwards;
}

@keyframes guideSparkle {
    0% {
        opacity: 0;
        transform: scale(0) rotate(0deg);
    }
    30% {
        opacity: 1;
        transform: scale(1.2) rotate(45deg);
    }
    70% {
        opacity: 1;
        transform: scale(1) rotate(135deg);
    }
    100% {
        opacity: 0;
        transform: scale(0) rotate(180deg);
    }
}

/* カードデッキ (出現前) */
.card-deck {
    perspective: 1000px;
    margin: 40px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    text-align: center;
}

.deck-stack {
    position: relative;
    width: 120px;
    height: 180px;
    cursor: pointer;
    transition: transform 0.3s;
    margin: 0 auto;
}

.deck-stack:hover {
    transform: scale(1.05);
}

.deck-card {
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(145deg, #2d1b4e, #1a1a2e);
    border: 2px solid var(--card-gold);
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.deck-card::before {
    content: '✦';
    font-size: 40px;
    color: var(--card-gold);
    opacity: 0.8;
}

.deck-card:nth-child(1) { transform: rotate(-2deg) translateY(0px); }
.deck-card:nth-child(2) { transform: rotate(1deg) translateY(-3px); }
.deck-card:nth-child(3) { transform: rotate(-1deg) translateY(-6px); }
.deck-card:nth-child(4) { transform: rotate(2deg) translateY(-9px); }
.deck-card:nth-child(5) { transform: rotate(0deg) translateY(-12px); }

.shuffle-text {
    margin-top: 20px;
    color: var(--text-gold);
    font-size: 1.1rem;
    animation: pulse 2s ease-in-out infinite;
    text-align: center;
    width: 100%;
}

@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* ========================================
   質問選択画面
   ======================================== */
.topic-selection {
    display: none;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 900px;
    z-index: 1;
    position: relative;
}

.topic-selection.active {
    display: flex;
}

.topic-header {
    text-align: center;
    margin-bottom: 15px;
}

.topic-header h2 {
    font-size: 1.8rem;
    color: var(--text-gold);
    margin-bottom: 10px;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.topic-header p {
    font-size: 1rem;
    opacity: 0.8;
    color: #b8a9c9;
}

.topic-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    width: 100%;
    margin-bottom: 30px;
}

.topic-card {
    background: linear-gradient(145deg, rgba(107, 91, 149, 0.3), rgba(26, 26, 46, 0.8));
    border: 2px solid rgba(212, 175, 55, 0.3);
    border-radius: 15px;
    padding: 20px 15px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.topic-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, transparent, rgba(212, 175, 55, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.topic-card:hover {
    transform: translateY(-5px) scale(1.02);
    border-color: var(--card-gold);
    box-shadow: 0 15px 30px rgba(212, 175, 55, 0.2),
                0 0 40px rgba(155, 89, 182, 0.2);
}

.topic-card:hover::before {
    opacity: 1;
}

.topic-card.selected {
    border-color: var(--card-gold);
    background: linear-gradient(145deg, rgba(155, 89, 182, 0.4), rgba(45, 27, 78, 0.8));
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.3);
}

.topic-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 10px;
}

.topic-card h3 {
    font-size: 1.1rem;
    color: var(--text-gold);
    margin-bottom: 8px;
}

.topic-card p {
    font-size: 0.8rem;
    opacity: 0.7;
    line-height: 1.4;
}

/* 自由入力エリア */
.custom-question {
    display: none;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 500px;
    margin-top: 20px;
    animation: fadeInUp 0.4s ease-out;
}

.custom-question.active {
    display: flex;
}

.custom-question label {
    font-size: 1rem;
    color: var(--text-gold);
    margin-bottom: 10px;
    text-align: center;
}

.custom-question textarea {
    width: 100%;
    height: 100px;
    padding: 15px;
    border: 2px solid rgba(212, 175, 55, 0.3);
    border-radius: 15px;
    background: rgba(26, 26, 46, 0.8);
    color: var(--text-light);
    font-family: inherit;
    font-size: 1rem;
    resize: none;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.custom-question textarea:focus {
    outline: none;
    border-color: var(--card-gold);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.2);
}

.custom-question textarea::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.proceed-button {
    margin-top: 20px;
    padding: 15px 40px;
    background: linear-gradient(135deg, var(--card-purple), var(--primary-color));
    border: none;
    border-radius: 30px;
    color: white;
    font-family: inherit;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 5px 20px rgba(155, 89, 182, 0.4);
}

.proceed-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(155, 89, 182, 0.6);
}

/* ========================================
   カード配置エリア
   ======================================== */
.cards-layout {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    padding: 30px 20px 20px;
    min-height: 300px;
}

/* 1枚引き */
.layout-single {
    justify-content: center;
    min-height: 200px;  /* 1枚だけなので高さを抑える */
    padding-top: 15px;
    padding-bottom: 15px;
}

/* 結果表示後：カードを上に移動 */
.layout-single.result-shown {
    margin-top: -80px;
    margin-bottom: 80px;
}

/* 3枚引き */
.layout-three {
    gap: 30px;
}

/* 5枚引き (十字型) */
.layout-five {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 15px;
    max-width: 450px;
}

.layout-five .tarot-card:nth-child(1) { grid-area: 1 / 2; } /* 過去 (上) */
.layout-five .tarot-card:nth-child(2) { grid-area: 2 / 1; } /* 障害 (左) */
.layout-five .tarot-card:nth-child(3) { grid-area: 2 / 2; } /* 現在 (中央) */
.layout-five .tarot-card:nth-child(4) { grid-area: 2 / 3; } /* 助言 (右) */
.layout-five .tarot-card:nth-child(5) { grid-area: 3 / 2; } /* 結果 (下) */

/* ケルト十字 (10枚) */
.layout-celtic {
    display: grid;
    grid-template-columns: repeat(6, 100px);
    grid-template-rows: repeat(4, 160px);
    gap: 8px;
    max-width: 750px;
    justify-content: center;
    padding-top: 30px;
}

.layout-celtic .tarot-card { 
    width: 90px;
    height: 130px;
    margin-top: 25px;
}
.layout-celtic .tarot-card:nth-child(1) { grid-area: 2 / 2; z-index: 1; } /* 現在 */
.layout-celtic .tarot-card:nth-child(2) { grid-area: 2 / 3; z-index: 2; } /* 障害 - 隣に配置 */
.layout-celtic .tarot-card:nth-child(3) { grid-area: 3 / 2; } /* 基盤 */
.layout-celtic .tarot-card:nth-child(4) { grid-area: 1 / 2; } /* 過去 */
.layout-celtic .tarot-card:nth-child(5) { grid-area: 1 / 3; } /* 王冠 */
.layout-celtic .tarot-card:nth-child(6) { grid-area: 3 / 3; } /* 未来 */
.layout-celtic .tarot-card:nth-child(7) { grid-area: 4 / 5; } /* 自分 */
.layout-celtic .tarot-card:nth-child(8) { grid-area: 3 / 5; } /* 環境 */
.layout-celtic .tarot-card:nth-child(9) { grid-area: 2 / 5; } /* 希望/恐れ */
.layout-celtic .tarot-card:nth-child(10) { grid-area: 1 / 5; } /* 結果 */

/* ========================================
   タロットカード
   ======================================== */
.tarot-card {
    position: relative;
    width: 120px;
    height: 180px;
    perspective: 1000px;
    cursor: pointer;
    opacity: 0;
    transform: translateY(-100px) rotateY(720deg);
    transition: opacity 0.8s, transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    margin-top: 20px;
}

.tarot-card.revealed {
    opacity: 1;
    transform: translateY(0) rotateY(0);
}

.tarot-card.dealing {
    animation: dealCard 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes dealCard {
    0% {
        opacity: 0;
        transform: translateY(-200px) rotateY(1080deg) scale(0.3);
    }
    60% {
        opacity: 1;
        transform: translateY(20px) rotateY(180deg) scale(1.1);
    }
    100% {
        opacity: 1;
        transform: translateY(0) rotateY(0) scale(1);
    }
}

.card-inner {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.tarot-card.flipped .card-inner {
    transform: rotateY(180deg);
}

.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    overflow: hidden;
}

/* カード裏面 */
.card-back {
    background: linear-gradient(145deg, #2d1b4e, #1a1a2e);
    border: 3px solid var(--card-gold);
}

.card-back-pattern {
    width: 90%;
    height: 90%;
    border: 2px solid rgba(212, 175, 55, 0.5);
    border-radius: 5px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(155, 89, 182, 0.1) 10px,
        rgba(155, 89, 182, 0.1) 20px
    );
}

.card-back-symbol {
    font-size: 50px;
    color: var(--card-gold);
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.5);
}

/* カード表面 */
.card-front {
    background: linear-gradient(180deg, #f5f0e8, #e8e0d5);
    border: 3px solid var(--card-gold);
    transform: rotateY(180deg);
    color: #2d1b4e;
    padding: 0;
    overflow: hidden;
}

.card-image {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-name {
    position: absolute;
    bottom: 25px;
    left: 0;
    right: 0;
    font-size: 0.7rem;
    font-weight: 700;
    text-align: center;
    color: white;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
    padding: 2px 5px;
    background: rgba(0, 0, 0, 0.5);
}

.card-number {
    position: absolute;
    bottom: 8px;
    left: 0;
    right: 0;
    font-size: 0.6rem;
    color: var(--text-gold);
    text-align: center;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
}

.card-position-label {
    position: absolute;
    top: -22px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.65rem;
    color: var(--text-gold);
    white-space: nowrap;
    background: rgba(26, 26, 46, 0.9);
    padding: 3px 8px;
    border-radius: 10px;
    border: 1px solid rgba(212, 175, 55, 0.4);
    z-index: 10;
}

/* 逆位置カード */
.card-front.card-reversed {
    transform: rotateY(180deg) rotate(180deg);
}

.card-front.card-reversed .card-image,
.card-front.card-reversed .card-name,
.card-front.card-reversed .card-number {
    /* 画像とテキストは正位置で表示(読みやすさのため) */
}

.reversed-indicator {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%) rotate(180deg);
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    font-size: 0.5rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

/* ========================================
   結果表示エリア
   ======================================== */
.results-area {
    width: 100%;
    max-width: 900px;
    margin-top: 40px;
    padding: 30px;
    background: linear-gradient(145deg, rgba(45, 27, 78, 0.6), rgba(26, 26, 46, 0.8));
    border-radius: 20px;
    border: 1px solid rgba(212, 175, 55, 0.3);
    display: none;
}

.results-area.active {
    display: block;
}

/* 通常時のフェードインアニメーション（fade-in-startがない時のみ） */
.results-area.active:not(.fade-in-start):not(.fade-in-complete) {
    animation: fadeInUp 0.6s ease-out;
}

/* フェードイン完了後は静的表示 */
.results-area.fade-in-complete {
    opacity: 1;
    transform: none;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.results-title {
    text-align: center;
    font-size: 1.5rem;
    color: var(--text-gold);
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.3);
}

.reading-topic {
    text-align: center;
    margin-bottom: 25px;
    padding: 15px 20px;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.1), rgba(155, 89, 182, 0.1));
    border-radius: 10px;
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.topic-label {
    color: var(--text-light);
    opacity: 0.8;
}

.topic-value {
    color: var(--text-gold);
    font-weight: 600;
}

.result-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    border-left: 4px solid var(--card-gold);
    transition: background 0.3s, border-left-color 0.3s, box-shadow 0.3s;
}

.result-card.result-reversed {
    border-left-color: #e74c3c;
    background: rgba(231, 76, 60, 0.05);
}

.result-card h4 {
    color: var(--text-gold);
    font-size: 1.1rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.result-card h4 span {
    font-size: 1.5rem;
}

.card-orientation {
    display: inline-block;
    font-size: 0.8rem;
    padding: 4px 12px;
    border-radius: 15px;
    margin-bottom: 8px;
    font-weight: 500;
}

.result-card:not(.result-reversed) .card-orientation {
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.2), rgba(39, 174, 96, 0.2));
    color: #2ecc71;
    border: 1px solid rgba(46, 204, 113, 0.3);
}

.result-card.result-reversed .card-orientation {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.2), rgba(192, 57, 43, 0.2));
    color: #e74c3c;
    border: 1px solid rgba(231, 76, 60, 0.3);
}

.result-card .position-name {
    font-size: 0.85rem;
    color: var(--card-purple);
    margin-bottom: 8px;
}

.result-card p {
    line-height: 1.8;
    opacity: 0.9;
}

.result-card-hint {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed rgba(212, 175, 55, 0.3);
    font-size: 0.8rem;
    color: var(--text-gold);
    opacity: 0.7;
    text-align: center;
    transition: opacity 0.3s;
}

.result-card:hover .result-card-hint {
    opacity: 1;
}

/* 1枚引き専用レイアウト */
.single-card-result {
    padding: 15px;
}

.single-card-layout {
    display: flex;
    gap: 15px;
    align-items: center;
}

.single-card-image {
    flex-shrink: 0;
    width: 80px;
}

.single-card-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.single-card-image img.reversed-image {
    transform: rotate(180deg);
}

.single-card-info {
    flex: 1;
}

.single-card-info h4 {
    margin-bottom: 8px;
}

.keywords-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.keyword-tag {
    display: inline-block;
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.15), rgba(184, 134, 11, 0.15));
    color: var(--text-gold);
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.result-reversed .keyword-tag {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.1), rgba(192, 57, 43, 0.1));
    color: #f5a5a0;
    border: 1px solid rgba(231, 76, 60, 0.3);
}

@media (max-width: 480px) {
    .single-card-image {
        width: 70px;
    }
    
    .keyword-tag {
        font-size: 0.7rem;
        padding: 3px 8px;
    }
}

.overall-message {
    text-align: center;
    padding: 25px;
    background: linear-gradient(135deg, rgba(155, 89, 182, 0.2), rgba(107, 91, 149, 0.2));
    border-radius: 15px;
    margin-top: 30px;
}

.overall-message h4 {
    color: var(--text-gold);
    font-size: 1.2rem;
    margin-bottom: 15px;
}

.overall-message p {
    line-height: 1.8;
    font-size: 1.05rem;
}

/* ========================================
   時の流れリーディング(3枚スプレッド専用)
   ======================================== */
.time-flow-reading {
    margin-bottom: 20px;
}

.time-flow-header {
    text-align: center;
    margin-bottom: 25px;
}

.time-flow-header h4 {
    font-size: 1.3rem;
    color: var(--text-gold);
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.time-flow-card {
    position: relative;
    border-left-width: 5px;
}

.time-flow-card[data-time="past"] {
    border-left-color: #95a5a6;
}

.time-flow-card[data-time="present"] {
    border-left-color: var(--card-gold);
    background: rgba(212, 175, 55, 0.05);
}

.time-flow-card[data-time="future"] {
    border-left-color: #9b59b6;
}

.time-flow-card.result-reversed[data-time="past"] {
    border-left-color: #7f8c8d;
}

.time-flow-card.result-reversed[data-time="present"] {
    border-left-color: #e67e22;
}

.time-flow-card.result-reversed[data-time="future"] {
    border-left-color: #c0392b;
}

/* スクロール表示アニメーション - ゆっくりふわっと神秘的に */
.scroll-reveal,
.scroll-reveal-card,
.result-card.scroll-reveal-card,
.time-flow-card.scroll-reveal-card {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 2.5s cubic-bezier(0.25, 0.1, 0.25, 1), 
                transform 2.5s cubic-bezier(0.25, 0.1, 0.25, 1) !important;
}

.scroll-reveal.revealed,
.scroll-reveal-card.revealed,
.result-card.scroll-reveal-card.revealed,
.time-flow-card.scroll-reveal-card.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* 最初から見える要素(ヘッダーと最初のカード)*/
.scroll-reveal.reveal-immediate,
.first-card,
.result-card.first-card,
.time-flow-card.first-card {
    opacity: 1;
    transform: translateY(0);
    transition: none !important;
}

.scroll-reveal.delay-1,
.scroll-reveal-card.delay-1 { transition-delay: 0.3s; }
.scroll-reveal.delay-2,
.scroll-reveal-card.delay-2 { transition-delay: 0.6s; }
.scroll-reveal.delay-3,
.scroll-reveal-card.delay-3 { transition-delay: 0.9s; }
.scroll-reveal.delay-4,
.scroll-reveal-card.delay-4 { transition-delay: 1.2s; }
.scroll-reveal.delay-5,
.scroll-reveal-card.delay-5 { transition-delay: 1.5s; }

/* スクロール促進の矢印アニメーション */
.scroll-hint {
    text-align: center;
    padding: 30px 20px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
    animation: bounceArrow 1.5s ease-in-out infinite;
}

.scroll-hint-arrow {
    display: block;
    font-size: 2rem;
    margin-bottom: 8px;
}

@keyframes bounceArrow {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(10px); }
}

.scroll-hint.hidden {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* タップして表示する物語 */
.story-reveal-container {
    margin-top: 30px;
    text-align: center;
}

.story-reveal-button {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.3), rgba(212, 175, 55, 0.1));
    border: 2px solid var(--card-gold);
    color: var(--card-gold);
    padding: 20px 40px;
    border-radius: 15px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    animation: glowPulse 2s ease-in-out infinite;
}

.story-reveal-button:hover {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.5), rgba(212, 175, 55, 0.2));
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.4);
}

.story-reveal-button .reveal-icon {
    display: block;
    font-size: 2rem;
    margin-bottom: 10px;
}

.story-reveal-button.hidden {
    display: none;
}

@keyframes glowPulse {
    0%, 100% { box-shadow: 0 0 10px rgba(212, 175, 55, 0.3); }
    50% { box-shadow: 0 0 25px rgba(212, 175, 55, 0.5); }
}

.story-content {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transform: translateY(30px);
    transition: opacity 2.5s cubic-bezier(0.25, 0.1, 0.25, 1), 
                max-height 1.5s ease-out,
                transform 2.5s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.story-content.revealed {
    opacity: 1;
    max-height: 2000px;
    transform: translateY(0);
}

/* 「もう一度物語を開く」ボタン */
.reopen-story-btn {
    display: block;
    margin: 20px auto 0;
    padding: 12px 25px;
    background: linear-gradient(135deg, rgba(155, 89, 182, 0.3), rgba(107, 91, 149, 0.2));
    border: 2px solid rgba(155, 89, 182, 0.5);
    border-radius: 25px;
    color: #e8d5a3;
    font-family: inherit;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    animation: subtleGlow 2s ease-in-out infinite;
}

.reopen-story-btn:hover {
    background: linear-gradient(135deg, rgba(155, 89, 182, 0.5), rgba(107, 91, 149, 0.4));
    border-color: rgba(212, 175, 55, 0.6);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(155, 89, 182, 0.3);
}

@keyframes subtleGlow {
    0%, 100% { 
        box-shadow: 0 0 10px rgba(155, 89, 182, 0.2);
    }
    50% { 
        box-shadow: 0 0 20px rgba(155, 89, 182, 0.4);
    }
}

/* 5枚スプレッド用スタイル */
.five-card-reading {
    margin-bottom: 20px;
}

.five-card-flow.role-past {
    border-left-color: #95a5a6;
}

.five-card-flow.role-present {
    border-left-color: var(--card-gold);
    background: rgba(212, 175, 55, 0.05);
}

.five-card-flow.role-challenge {
    border-left-color: #e74c3c;
    background: rgba(231, 76, 60, 0.05);
}

.five-card-flow.role-advice {
    border-left-color: #3498db;
    background: rgba(52, 152, 219, 0.05);
}

.five-card-flow.role-outcome {
    border-left-color: #9b59b6;
    background: rgba(155, 89, 182, 0.05);
}

.five-card-flow.result-reversed.role-past {
    border-left-color: #7f8c8d;
}

.five-card-flow.result-reversed.role-present {
    border-left-color: #e67e22;
}

.five-card-flow.result-reversed.role-challenge {
    border-left-color: #c0392b;
    background: rgba(192, 57, 43, 0.08);
}

.five-card-flow.result-reversed.role-advice {
    border-left-color: #2980b9;
}

.five-card-flow.result-reversed.role-outcome {
    border-left-color: #8e44ad;
    background: rgba(142, 68, 173, 0.08);
}

.five-card-story {
    border: 2px solid rgba(155, 89, 182, 0.3);
}

.time-position-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.time-icon {
    font-size: 1.5rem;
}

.time-label {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-gold);
}

.time-flow-card .position-name {
    display: none; /* time-position-badgeで表示するので非表示 */
}

/* 繋ぎ部分 */
.time-flow-connector {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px 0;
    position: relative;
}

.connector-arrow {
    font-size: 2rem;
    color: var(--card-gold);
    animation: arrowPulse 1.5s ease-in-out infinite;
    text-shadow: 0 0 15px rgba(212, 175, 55, 0.5);
}

@keyframes arrowPulse {
    0%, 100% { opacity: 0.5; transform: translateY(0); }
    50% { opacity: 1; transform: translateY(5px); }
}

.connector-text {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.7);
    font-style: italic;
    margin-top: 5px;
    text-align: center;
}

/* 物語へのコネクター（特別なスタイル） */
.story-connector {
    padding: 25px 0;
    margin-top: 10px;
}

.story-connector .connector-arrow {
    font-size: 2.5rem;
    animation: sparkleGlow 2s ease-in-out infinite;
}

@keyframes sparkleGlow {
    0%, 100% { 
        opacity: 0.6; 
        transform: scale(1);
        text-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
    }
    50% { 
        opacity: 1; 
        transform: scale(1.1);
        text-shadow: 0 0 25px rgba(212, 175, 55, 0.8), 0 0 40px rgba(155, 89, 182, 0.5);
    }
}

.story-connector .connector-text {
    font-size: 1.05rem;
    color: rgba(255, 215, 0, 0.85);
    margin-top: 10px;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

/* 3枚の物語 */
.time-flow-story {
    text-align: center;
    padding: 30px 25px;
    background: linear-gradient(135deg, rgba(155, 89, 182, 0.15), rgba(107, 91, 149, 0.15));
    border-radius: 20px;
    margin-top: 30px;
    border: 2px solid rgba(212, 175, 55, 0.2);
    position: relative;
    overflow: hidden;
}

.time-flow-story::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent, rgba(212, 175, 55, 0.05), transparent);
    pointer-events: none;
}

.time-flow-story h4 {
    color: var(--text-gold);
    font-size: 1.25rem;
    margin-bottom: 18px;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.time-flow-story p {
    line-height: 2;
    font-size: 1.05rem;
    color: var(--text-light);
}

.retry-button {
    display: block;
    margin: 30px auto 0;
    padding: 15px 40px;
    background: linear-gradient(135deg, var(--card-purple), var(--primary-color));
    border: none;
    border-radius: 30px;
    color: white;
    font-family: inherit;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 5px 20px rgba(155, 89, 182, 0.4);
}

.retry-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(155, 89, 182, 0.6);
}

/* ========================================
   シェアボタン
   ======================================== */
.share-section {
    text-align: center;
    margin: 30px 0;
    padding: 25px;
    background: linear-gradient(135deg, rgba(107, 91, 149, 0.2), rgba(26, 26, 46, 0.5));
    border-radius: 20px;
    border: 1px solid rgba(212, 175, 55, 0.2);
}

.share-title {
    font-size: 1rem;
    color: var(--text-gold);
    margin-bottom: 15px;
}

.share-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.share-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
}

.share-btn:hover {
    transform: translateY(-5px) scale(1.1);
}

.share-btn:active {
    transform: translateY(-2px) scale(1.05);
}

.share-btn.twitter {
    background: linear-gradient(135deg, #1a1a1a, #333);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.share-btn.twitter:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.share-btn.line {
    background: linear-gradient(135deg, #00B900, #00C300);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 185, 0, 0.3);
}

.share-btn.line:hover {
    box-shadow: 0 8px 25px rgba(0, 185, 0, 0.4);
}

.share-btn.instagram {
    background: linear-gradient(135deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
    color: white;
    box-shadow: 0 4px 15px rgba(225, 48, 108, 0.3);
}

.share-btn.instagram:hover {
    box-shadow: 0 8px 25px rgba(225, 48, 108, 0.4);
}

.share-btn.copy {
    background: linear-gradient(135deg, var(--card-purple), var(--primary-color));
    color: white;
    box-shadow: 0 4px 15px rgba(155, 89, 182, 0.3);
}

.share-btn.copy:hover {
    box-shadow: 0 8px 25px rgba(155, 89, 182, 0.4);
}

.copy-tooltip {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--card-gold);
    color: #1a1a2e;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.share-btn.copy.copied .copy-tooltip {
    opacity: 1;
}

/* ========================================
   レスポンシブ対応
   ======================================== */
@media screen and (min-width: 769px) {
    /* PC表示 - 回転促し画面を非表示 */
    .rotation-prompt {
        display: none !important;
    }
    
    .main-container {
        opacity: 1;
    }
    
    .spread-menu {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .header h1 {
        font-size: 3rem;
    }
    
    .tarot-card {
        width: 140px;
        height: 210px;
    }
    
    .layout-five {
        max-width: 550px;
    }
    
    .layout-celtic {
        grid-template-columns: repeat(6, 120px);
        grid-template-rows: repeat(4, 190px);
        max-width: 900px;
    }
    
    .layout-celtic .tarot-card {
        width: 110px;
        height: 160px;
        margin-top: 25px;
    }
    
    .topic-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
    
    .topic-card {
        padding: 25px 20px;
    }
    
    .topic-icon {
        font-size: 3rem;
    }
}

@media screen and (max-width: 768px) and (orientation: portrait) {
    /* スマホ・タブレット縦向き - 回転促し画面を表示 */
    .rotation-prompt {
        display: flex !important;
    }
    
    .main-container {
        opacity: 0;
    }
}

@media screen and (max-width: 768px) and (orientation: landscape) {
    /* スマホ・タブレット横向き */
    .rotation-prompt {
        display: none !important;
    }
    
    .main-container {
        opacity: 1;
        padding: 15px;
    }
    
    .header {
        margin-bottom: 20px;
    }
    
    .header h1 {
        font-size: 1.8rem;
    }
    
    .spread-menu {
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
    }
    
    .spread-card {
        padding: 15px 10px;
    }
    
    .spread-card h3 {
        font-size: 1rem;
    }
    
    .spread-card p {
        font-size: 0.75rem;
    }
    
    .spread-icon {
        font-size: 2rem;
    }
    
    .spread-menu-divider {
        margin: 5px 0 0;
        gap: 10px;
    }
    
    .divider-label {
        font-size: 0.7rem;
    }
    
    .game-badge {
        top: 8px;
        right: 8px;
        font-size: 0.55rem;
        padding: 2px 8px;
    }
    
    .tarot-card {
        width: 90px;
        height: 135px;
    }
    
    .card-back-symbol {
        font-size: 35px;
    }
    
    .card-image {
        font-size: 30px;
    }
    
    .card-name {
        font-size: 0.6rem;
    }
    
    .results-area {
        padding: 15px;
    }
    
    .layout-celtic {
        grid-template-columns: repeat(6, 70px);
        grid-template-rows: repeat(4, 115px);
        padding-top: 20px;
    }
    
    .layout-celtic .tarot-card {
        width: 60px;
        height: 90px;
        margin-top: 18px;
    }
    
    .layout-celtic .card-back-symbol {
        font-size: 20px;
    }
    
    .layout-celtic .card-image {
        font-size: 18px;
    }
    
    .layout-celtic .card-name {
        font-size: 0.45rem;
    }
    
    .layout-celtic .card-number {
        font-size: 0.4rem;
    }
    
    .layout-celtic .card-position-label {
        font-size: 0.45rem;
        top: -16px;
        padding: 2px 5px;
    }
    
    /* 質問選択画面 - モバイル横向き */
    .topic-header h2 {
        font-size: 1.3rem;
    }
    
    .topic-header p {
        font-size: 0.85rem;
    }
    
    .topic-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    
    .topic-card {
        padding: 12px 8px;
    }
    
    .topic-icon {
        font-size: 1.5rem;
        margin-bottom: 5px;
    }
    
    .topic-card h3 {
        font-size: 0.8rem;
        margin-bottom: 4px;
    }
    
    .topic-card p {
        font-size: 0.65rem;
        display: none; /* モバイルでは説明を非表示 */
    }
    
    .custom-question textarea {
        height: 60px;
        font-size: 0.9rem;
    }
    
    .proceed-button {
        padding: 10px 25px;
        font-size: 0.9rem;
    }
    
    /* シェアボタン - モバイル */
    .share-section {
        padding: 15px;
        margin: 20px 0;
    }
    
    .share-title {
        font-size: 0.9rem;
        margin-bottom: 10px;
    }
    
    .share-buttons {
        gap: 10px;
    }
    
    .share-btn {
        width: 42px;
        height: 42px;
    }
    
    .share-btn svg {
        width: 18px;
        height: 18px;
    }
    
    /* 時の流れリーディング - モバイル */
    .time-flow-header h4 {
        font-size: 1.1rem;
    }
    
    .time-icon {
        font-size: 1.2rem;
    }
    
    .time-label {
        font-size: 0.95rem;
    }
    
    .connector-arrow {
        font-size: 1.5rem;
    }
    
    .connector-text {
        font-size: 0.85rem;
    }
    
    .time-flow-story {
        padding: 20px 15px;
    }
    
    .time-flow-story h4 {
        font-size: 1.05rem;
    }
    
    .time-flow-story p {
        font-size: 0.9rem;
        line-height: 1.8;
    }
}

/* 言語切り替えボタン */
/* 上部コントロールバー */
.top-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 800px;
    padding: 10px 5px;
    margin-bottom: 15px;
    z-index: 100;
}

.audio-controls-inline {
    display: flex;
    gap: 8px;
}

.audio-controls-inline .audio-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(26, 26, 46, 0.8);
    border: 2px solid rgba(212, 175, 55, 0.4);
    color: var(--text-gold);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    justify-content: center;
    align-items: center;
}

.audio-controls-inline .audio-btn:hover {
    background: rgba(212, 175, 55, 0.2);
    border-color: var(--card-gold);
}

.audio-controls-inline .audio-btn.muted {
    opacity: 0.5;
    border-color: rgba(255, 255, 255, 0.2);
}

.lang-switch {
    display: flex;
    gap: 5px;
    z-index: 100;
}

.right-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.lang-btn {
    padding: 8px 15px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    color: var(--text-light);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s;
}

.lang-btn.active {
    background: var(--card-gold);
    color: #1a1a2e;
    border-color: var(--card-gold);
}

.lang-btn:hover:not(.active) {
    background: rgba(255, 255, 255, 0.2);
}

/* ========================================
   お知らせボタン
   ======================================== */
.notification-btn {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(26, 26, 46, 0.8);
    border: 2px solid rgba(212, 175, 55, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-btn:hover {
    border-color: var(--card-gold);
    background: rgba(212, 175, 55, 0.2);
}

.notification-icon {
    font-size: 1.2rem;
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #ff6b6b, #ee5a5a);
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: badgePulse 2s ease-in-out infinite;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.5);
}

.notification-badge.hidden {
    display: none;
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* ========================================
   お知らせモーダル
   ======================================== */
.notification-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 26, 46, 0.95);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10003;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.notification-modal.active {
    display: flex;
    opacity: 1;
}

.notification-modal-content {
    background: linear-gradient(145deg, rgba(107, 91, 149, 0.3), rgba(26, 26, 46, 0.95));
    border: 2px solid rgba(212, 175, 55, 0.5);
    border-radius: 20px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.notification-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.notification-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.3);
}

.notification-header-icon {
    font-size: 1.5rem;
}

.notification-header h2 {
    font-size: 1.4rem;
    color: var(--text-gold);
    margin: 0;
}

.notification-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.notification-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 15px;
    border-left: 3px solid var(--card-gold);
}

.notification-item.unread {
    background: rgba(212, 175, 55, 0.1);
    border-left-color: #ff6b6b;
}

.notification-item-date {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 8px;
}

.notification-item-title {
    font-size: 1rem;
    color: var(--text-gold);
    margin-bottom: 8px;
    font-weight: bold;
}

.notification-item-content {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
}

.notification-empty {
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    padding: 30px;
}

/* ========================================
   オーディオコントロール（元の固定位置用 - 非表示）
   ======================================== */
.audio-controls {
    display: none; /* 新レイアウトでは非表示 */
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 100;
    gap: 8px;
}

.audio-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: rgba(26, 26, 46, 0.9);
    border: 2px solid rgba(212, 175, 55, 0.5);
    color: var(--text-gold);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* ON時（mutedじゃないとき）は輪っかが光る */
.audio-btn:not(.muted) {
    border-color: var(--card-gold);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.5), 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* PC（マウス操作）のみhoverで拡大 */
@media (hover: hover) and (pointer: fine) {
    .audio-btn:hover {
        transform: scale(1.1);
        border-color: var(--card-gold);
        box-shadow: 0 0 20px rgba(212, 175, 55, 0.4);
    }
}

/* タップ時の一瞬の反応 */
.audio-btn:active {
    transform: scale(0.95);
}

.audio-btn.muted {
    opacity: 0.5;
    border-color: rgba(212, 175, 55, 0.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.audio-btn .icon-on,
.audio-btn .icon-off {
    display: none;
}

.audio-btn:not(.muted) .icon-on {
    display: block;
}

.audio-btn.muted .icon-off {
    display: block;
}

/* 音楽ビジュアライザー風アニメーション */
.audio-visualizer {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 15px;
}

.audio-visualizer .bar {
    width: 3px;
    background: var(--card-gold);
    border-radius: 2px;
    animation: audioBar 0.5s ease-in-out infinite alternate;
}

.audio-btn.muted .audio-visualizer .bar {
    animation: none;
    height: 3px !important;
}

.audio-visualizer .bar:nth-child(1) { animation-delay: 0s; }
.audio-visualizer .bar:nth-child(2) { animation-delay: 0.1s; }
.audio-visualizer .bar:nth-child(3) { animation-delay: 0.2s; }
.audio-visualizer .bar:nth-child(4) { animation-delay: 0.1s; }

@keyframes audioBar {
    0% { height: 3px; }
    100% { height: 15px; }
}

/* ========================================
   オープニング画面（リッチアニメーション）
   ======================================== */
.audio-start-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #0a0a1a 0%, #1a1a2e 50%, #0d0d1a 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 1;
    transition: opacity 1s ease-out;
    overflow: hidden;
}

.audio-start-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

/* 流れ星エフェクト */
.shooting-stars {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.shooting-star {
    position: absolute;
    width: 4px;
    height: 4px;
    background: linear-gradient(45deg, #fff, transparent);
    border-radius: 50%;
    animation: shootingStar 3s linear infinite;
    opacity: 0;
}

.shooting-star::before {
    content: '';
    position: absolute;
    width: 80px;
    height: 2px;
    background: linear-gradient(90deg, rgba(255,255,255,0.8), transparent);
    transform: translateX(-100%);
    top: 50%;
    right: 0;
}

.shooting-star:nth-child(1) { top: 10%; left: 20%; animation-delay: 0s; }
.shooting-star:nth-child(2) { top: 30%; left: 60%; animation-delay: 1.5s; }
.shooting-star:nth-child(3) { top: 50%; left: 40%; animation-delay: 3s; }
.shooting-star:nth-child(4) { top: 20%; left: 80%; animation-delay: 4.5s; }
.shooting-star:nth-child(5) { top: 70%; left: 30%; animation-delay: 2s; }

@keyframes shootingStar {
    0% {
        opacity: 0;
        transform: translate(0, 0) rotate(45deg);
    }
    10% {
        opacity: 1;
    }
    70% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translate(300px, 300px) rotate(45deg);
    }
}

/* キラキラ星 */
.sparkle-stars {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.sparkle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: #fff;
    border-radius: 50%;
    animation: sparkle 2s ease-in-out infinite;
    box-shadow: 0 0 10px #fff, 0 0 20px rgba(255, 215, 0, 0.5);
}

.sparkle:nth-child(1) { top: 15%; left: 10%; animation-delay: 0s; }
.sparkle:nth-child(2) { top: 25%; left: 85%; animation-delay: 0.5s; }
.sparkle:nth-child(3) { top: 60%; left: 15%; animation-delay: 1s; }
.sparkle:nth-child(4) { top: 75%; left: 75%; animation-delay: 1.5s; }
.sparkle:nth-child(5) { top: 40%; left: 5%; animation-delay: 0.3s; }
.sparkle:nth-child(6) { top: 85%; left: 50%; animation-delay: 0.8s; }
.sparkle:nth-child(7) { top: 10%; left: 60%; animation-delay: 1.2s; }
.sparkle:nth-child(8) { top: 55%; left: 90%; animation-delay: 0.7s; }

@keyframes sparkle {
    0%, 100% {
        opacity: 0.3;
        transform: scale(0.8);
    }
    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

.audio-start-content {
    text-align: center;
    padding: 40px;
    position: relative;
    z-index: 1;
}

/* サブタイトル（シーナシティの母アンネの） */
.opening-subtitle {
    font-size: 1.1rem;
    color: rgba(232, 213, 163, 0.9);
    margin-bottom: 15px;
    opacity: 0;
    animation: fadeInUp 1.5s ease-out 0.3s forwards;
    text-shadow: 0 0 15px rgba(232, 213, 163, 0.4);
    letter-spacing: 0.1em;
}

/* メインタイトル（タロット占い） */
.opening-title {
    font-size: 2.8rem;
    color: var(--text-gold);
    margin-bottom: 30px;
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.6),
                 0 0 60px rgba(255, 215, 0, 0.3);
    opacity: 0;
    animation: fadeInUp 1.5s ease-out 0.8s forwards, titleGlow 3s ease-in-out 2.3s infinite;
}

@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* デコレーションライン */
.opening-decoration {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 40px;
    opacity: 0;
    animation: fadeInUp 1.5s ease-out 1.5s forwards;
}

.opening-decoration .deco-line {
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--card-gold), transparent);
}

.opening-decoration .deco-star {
    color: var(--text-gold);
    font-size: 1.2rem;
    animation: rotateStar 4s linear infinite;
}

@keyframes rotateStar {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.audio-start-content h2 {
    display: none; /* 新しいタイトル構造を使うので非表示 */
}

/* 旧メワヨワメコンピュータはHTML側でstyle="display:none"で非表示 */

.start-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    opacity: 0;
    animation: fadeInUp 1.5s ease-out 2s forwards;
}

.start-btn {
    padding: 18px 50px;
    border-radius: 35px;
    font-family: inherit;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.start-btn.with-sound {
    background: linear-gradient(135deg, var(--card-purple), var(--primary-color));
    border: 2px solid rgba(212, 175, 55, 0.5);
    color: white;
    box-shadow: 0 5px 30px rgba(155, 89, 182, 0.5),
                0 0 20px rgba(212, 175, 55, 0.2);
}

.start-btn.with-sound:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 10px 40px rgba(155, 89, 182, 0.7),
                0 0 30px rgba(212, 175, 55, 0.4);
}

.start-btn.without-sound {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: var(--text-light);
}

.start-btn.without-sound:hover {
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-3px);
}

.audio-note {
    margin-top: 25px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    opacity: 0;
    animation: fadeInUp 1.5s ease-out 2.3s forwards;
}

/* インストールボタン */
.install-prompt {
    margin-top: 40px;
    text-align: center;
    opacity: 0;
    animation: fadeInUp 1.5s ease-out 2.8s forwards;
}

.install-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 25px;
    background: transparent;
    border: 1px solid rgba(212, 175, 55, 0.5);
    border-radius: 30px;
    color: rgba(212, 175, 55, 0.8);
    font-family: inherit;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.install-btn:hover {
    background: rgba(212, 175, 55, 0.15);
    border-color: rgba(212, 175, 55, 0.8);
    color: var(--card-gold);
    transform: translateY(-2px);
}

.install-icon {
    font-size: 1.2rem;
}

.install-note {
    margin-top: 10px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.4);
}

/* 既にインストール済み or 非対応ブラウザでは非表示 */
.install-prompt.hidden {
    display: none;
}

/* PWA（アプリ）として起動時はインストールボタンを非表示 */
@media (display-mode: standalone), (display-mode: fullscreen) {
    .install-prompt {
        display: none !important;
    }
}

/* インストールモーダル */
.install-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 30, 0.95);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10005;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.install-modal.active {
    display: flex;
    opacity: 1;
}

.install-modal-content {
    background: linear-gradient(135deg, #2d1b4e 0%, #1a1a2e 100%);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 20px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    position: relative;
    box-shadow: 0 0 40px rgba(212, 175, 55, 0.2);
}

.install-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.3s;
}

.install-modal-close:hover {
    color: white;
}

.install-modal-title {
    text-align: center;
    color: var(--card-gold);
    font-size: 1.3rem;
    margin-bottom: 25px;
}

.install-instructions {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.install-device {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 15px;
}

.install-device h4 {
    color: var(--text-gold);
    margin-bottom: 10px;
    font-size: 1rem;
}

.install-device ol {
    margin-left: 20px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    line-height: 1.8;
}

.install-device li {
    margin-bottom: 5px;
}

.install-benefit {
    text-align: center;
    margin-top: 20px;
    color: rgba(212, 175, 55, 0.8);
    font-size: 0.9rem;
}

/* モバイル対応 */
@media (max-width: 480px) {
    .opening-subtitle {
        font-size: 0.9rem;
    }
    
    .opening-title {
        font-size: 2rem;
    }
    
    .start-btn {
        padding: 15px 40px;
        font-size: 1.1rem;
    }
}

/* ========================================
   カード確認演出オーバーレイ
   ======================================== */
.cards-ready-overlay {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: auto;
    background: linear-gradient(to top, rgba(10, 10, 35, 0.98) 0%, rgba(10, 10, 35, 0.95) 60%, transparent 100%);
    display: none;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    padding: 60px 20px 40px;
    z-index: 10001;
    opacity: 0;
    transform: translateY(100%);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.cards-ready-overlay.active {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

/* キラキラエフェクト（画面全体） */
.cards-ready-sparkles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 10000;
    display: none;
}

.cards-ready-sparkles.active {
    display: block;
}

.cards-ready-sparkle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: radial-gradient(circle, rgba(212, 175, 55, 1) 0%, transparent 70%);
    border-radius: 50%;
    animation: sparkleFloat 3s ease-in-out infinite;
}

@keyframes sparkleFloat {
    0%, 100% {
        transform: translateY(0) scale(1);
        opacity: 0.8;
    }
    50% {
        transform: translateY(-20px) scale(1.2);
        opacity: 1;
    }
}

/* メッセージ */
.cards-ready-message {
    font-size: 1.4rem;
    color: var(--card-gold);
    text-align: center;
    margin-bottom: 30px;
    opacity: 0;
    transform: translateY(20px);
    animation: messageAppear 1s ease-out 0.5s forwards;
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.5);
    font-weight: 500;
    letter-spacing: 2px;
}

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

/* 結果を見るボタン */
.cards-ready-button {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 40px;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.3), rgba(212, 175, 55, 0.1));
    border: 2px solid var(--card-gold);
    border-radius: 50px;
    color: var(--card-gold);
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    opacity: 0;
    transform: translateY(20px);
    animation: buttonAppear 0.8s ease-out 3s forwards;
    transition: all 0.3s ease;
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.3);
}

.cards-ready-button:hover {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.5), rgba(212, 175, 55, 0.2));
    transform: translateY(0) scale(1.05);
    box-shadow: 0 0 50px rgba(212, 175, 55, 0.5);
}

.cards-ready-button .button-icon {
    font-size: 1.3rem;
    animation: iconPulse 1.5s ease-in-out infinite;
}

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

@keyframes iconPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.8;
    }
    50% {
        transform: scale(1.2);
        opacity: 1;
    }
}

/* カードの光のオーラ（テーブル上のカード用） */
.tarot-card.card-glow {
    animation: cardGlowAura 2s ease-in-out infinite;
}

.tarot-card.card-glow::after {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background: radial-gradient(ellipse, rgba(212, 175, 55, 0.4) 0%, transparent 70%);
    border-radius: 15px;
    z-index: -1;
    animation: glowPulse 2s ease-in-out infinite;
}

@keyframes cardGlowAura {
    0%, 100% {
        filter: brightness(1) drop-shadow(0 0 10px rgba(212, 175, 55, 0.5));
    }
    50% {
        filter: brightness(1.1) drop-shadow(0 0 25px rgba(212, 175, 55, 0.8));
    }
}

@keyframes glowPulse {
    0%, 100% {
        opacity: 0.5;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

/* ========================================
   結果表示前の導入演出オーバーレイ
   ======================================== */
.pre-result-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 25, 0.95);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10002;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.pre-result-overlay.active {
    display: flex;
    opacity: 1;
}

.pre-result-overlay.fade-out {
    opacity: 0;
}

/* キラキラ背景 */
.pre-result-sparkles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.pre-result-sparkle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 10px #fff, 0 0 20px rgba(255, 215, 0, 0.5);
    animation: preResultSparkle 2s ease-in-out infinite;
}

.pre-result-sparkle:nth-child(1) { top: 10%; left: 15%; animation-delay: 0s; }
.pre-result-sparkle:nth-child(2) { top: 20%; left: 80%; animation-delay: 0.3s; }
.pre-result-sparkle:nth-child(3) { top: 35%; left: 10%; animation-delay: 0.6s; }
.pre-result-sparkle:nth-child(4) { top: 45%; left: 90%; animation-delay: 0.9s; }
.pre-result-sparkle:nth-child(5) { top: 60%; left: 20%; animation-delay: 0.2s; }
.pre-result-sparkle:nth-child(6) { top: 70%; left: 75%; animation-delay: 0.5s; }
.pre-result-sparkle:nth-child(7) { top: 85%; left: 30%; animation-delay: 0.8s; }
.pre-result-sparkle:nth-child(8) { top: 90%; left: 85%; animation-delay: 0.1s; }
.pre-result-sparkle:nth-child(9) { top: 15%; left: 50%; animation-delay: 0.4s; }
.pre-result-sparkle:nth-child(10) { top: 75%; left: 50%; animation-delay: 0.7s; }

@keyframes preResultSparkle {
    0%, 100% { opacity: 0.3; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.5); }
}

/* コンテンツ */
.pre-result-content {
    text-align: center;
    z-index: 1;
    padding: 20px;
}

/* カードプレビュー */
.pre-result-cards {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.pre-result-card {
    width: 70px;
    height: 105px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 25px rgba(212, 175, 55, 0.4),
                0 0 40px rgba(155, 89, 182, 0.3);
    opacity: 0;
    transform: translateY(30px) scale(0.8);
    animation: preResultCardAppear 0.8s ease-out forwards;
}

.pre-result-card:nth-child(1) { animation-delay: 0.2s; }
.pre-result-card:nth-child(2) { animation-delay: 0.4s; }
.pre-result-card:nth-child(3) { animation-delay: 0.6s; }
.pre-result-card:nth-child(4) { animation-delay: 0.8s; }
.pre-result-card:nth-child(5) { animation-delay: 1.0s; }
.pre-result-card:nth-child(6) { animation-delay: 1.2s; }
.pre-result-card:nth-child(7) { animation-delay: 1.4s; }
.pre-result-card:nth-child(8) { animation-delay: 1.6s; }
.pre-result-card:nth-child(9) { animation-delay: 1.8s; }
.pre-result-card:nth-child(10) { animation-delay: 2.0s; }

@keyframes preResultCardAppear {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.8);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.pre-result-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pre-result-card.reversed img {
    transform: rotate(180deg);
}

/* メッセージテキスト */
.pre-result-message {
    font-size: 1.4rem;
    color: var(--text-gold);
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.6),
                 0 0 60px rgba(255, 215, 0, 0.3);
    opacity: 0;
    transform: translateY(20px);
    animation: preResultMessageAppear 1.2s ease-out 1.5s forwards;
    line-height: 1.8;
    letter-spacing: 0.1em;
}

@keyframes preResultMessageAppear {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* デコレーション */
.pre-result-decoration {
    margin-top: 30px;
    opacity: 0;
    animation: preResultDecoAppear 1s ease-out 2.5s forwards;
}

@keyframes preResultDecoAppear {
    0% { opacity: 0; }
    100% { opacity: 0.7; }
}

.pre-result-decoration .deco-line {
    display: inline-block;
    width: 50px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--card-gold), transparent);
    vertical-align: middle;
    margin: 0 15px;
}

.pre-result-decoration .deco-star {
    color: var(--text-gold);
    font-size: 1rem;
}

/* レスポンシブ */
@media (max-width: 480px) {
    .pre-result-card {
        width: 55px;
        height: 82px;
    }
    
    .pre-result-cards {
        gap: 8px;
    }
    
    .pre-result-message {
        font-size: 1.1rem;
        padding: 0 15px;
    }
}

/* ========================================
   水晶玉トランジション演出
   ======================================== */
.crystal-transition {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10003;
    pointer-events: none;
}

.crystal-transition.active {
    display: flex;
}

/* 神秘的な霧のオーバーレイ - 軽量版 */
.crystal-fog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, 
        rgba(45, 27, 78, 0.95) 0%,
        rgba(26, 26, 46, 0.98) 50%,
        rgba(10, 10, 25, 0.99) 100%);
    z-index: 10004;
    opacity: 0;
    pointer-events: none;
    will-change: opacity;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

.crystal-fog.active {
    opacity: 1;
    -webkit-transition: opacity 0.5s ease;
    transition: opacity 0.5s ease;
}

.crystal-fog.clearing {
    opacity: 0;
    -webkit-transition: opacity 2.5s ease-out;
    transition: opacity 2.5s ease-out;
}

/* 光の輪 */
.crystal-ring {
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    border: 3px solid transparent;
    background: 
        linear-gradient(rgba(10, 10, 25, 0.98), rgba(10, 10, 25, 0.98)) padding-box,
        linear-gradient(135deg, #d4af37, #9b59b6, #3498db, #d4af37) border-box;
    box-shadow: 
        0 0 60px rgba(212, 175, 55, 0.4),
        0 0 120px rgba(155, 89, 182, 0.3),
        inset 0 0 60px rgba(212, 175, 55, 0.1);
    opacity: 0;
    z-index: 10006;
    will-change: transform, opacity;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

.crystal-ring.converge {
    animation: crystalConverge 1.2s ease-in forwards;
}

.crystal-ring.expand {
    animation: crystalExpand 1.5s ease-out forwards;
}

@keyframes crystalConverge {
    0% {
        opacity: 0;
        transform: scale(4) translateZ(0);
    }
    40% {
        opacity: 1;
    }
    100% {
        opacity: 1;
        transform: scale(0.2) translateZ(0);
    }
}

@keyframes crystalExpand {
    0% {
        opacity: 1;
        transform: scale(0.2) translateZ(0);
    }
    30% {
        opacity: 1;
        transform: scale(1.2) translateZ(0);
        box-shadow: 
            0 0 100px rgba(212, 175, 55, 0.9),
            0 0 200px rgba(155, 89, 182, 0.7);
    }
    60% {
        opacity: 0.7;
        transform: scale(2.5) translateZ(0);
    }
    100% {
        opacity: 0;
        transform: scale(5) translateZ(0);
    }
}

/* 中央の光の核 */
.crystal-core {
    position: absolute;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: radial-gradient(circle, #fff 0%, #d4af37 40%, transparent 70%);
    box-shadow: 
        0 0 40px #fff,
        0 0 80px rgba(212, 175, 55, 0.9);
    opacity: 0;
    z-index: 10006;
    will-change: transform, opacity;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

.crystal-core.pulse {
    animation: crystalCorePulse 2.5s ease-in-out forwards;
}

@keyframes crystalCorePulse {
    0% {
        opacity: 0;
        transform: scale(0) translateZ(0);
    }
    20% {
        opacity: 1;
        transform: scale(1) translateZ(0);
    }
    35% {
        transform: scale(0.7) translateZ(0);
    }
    50% {
        opacity: 1;
        transform: scale(2) translateZ(0);
    }
    70% {
        opacity: 0.8;
        transform: scale(3) translateZ(0);
    }
    100% {
        opacity: 0;
        transform: scale(5) translateZ(0);
    }
}

/* キラキラパーティクル */
.crystal-particles {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10006;
}

.crystal-particle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 15px #fff, 0 0 30px rgba(212, 175, 55, 0.9);
    opacity: 0;
}

.crystal-particle.burst {
    animation: particleBurst 1.8s ease-out forwards;
}

.crystal-particle:nth-child(1) { --angle: 0deg; --distance: 200px; animation-delay: 0s; }
.crystal-particle:nth-child(2) { --angle: 45deg; --distance: 240px; animation-delay: 0.08s; }
.crystal-particle:nth-child(3) { --angle: 90deg; --distance: 220px; animation-delay: 0.16s; }
.crystal-particle:nth-child(4) { --angle: 135deg; --distance: 230px; animation-delay: 0.08s; }
.crystal-particle:nth-child(5) { --angle: 180deg; --distance: 210px; animation-delay: 0s; }
.crystal-particle:nth-child(6) { --angle: 225deg; --distance: 235px; animation-delay: 0.08s; }
.crystal-particle:nth-child(7) { --angle: 270deg; --distance: 225px; animation-delay: 0.16s; }
.crystal-particle:nth-child(8) { --angle: 315deg; --distance: 245px; animation-delay: 0.08s; }
.crystal-particle:nth-child(9) { --angle: 22.5deg; --distance: 280px; animation-delay: 0.12s; }
.crystal-particle:nth-child(10) { --angle: 67.5deg; --distance: 260px; animation-delay: 0.04s; }
.crystal-particle:nth-child(11) { --angle: 112.5deg; --distance: 290px; animation-delay: 0.1s; }
.crystal-particle:nth-child(12) { --angle: 157.5deg; --distance: 270px; animation-delay: 0.02s; }

@keyframes particleBurst {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) rotate(var(--angle)) translateY(0);
    }
    60% {
        opacity: 0.8;
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) rotate(var(--angle)) translateY(calc(var(--distance) * -1));
    }
}

/* 結果画面のフェードイン演出 - GPU加速版 */
.results-area.fade-in-start,
.results-area.active.fade-in-start {
    opacity: 0 !important;
    visibility: visible !important;
    will-change: opacity;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-transition: opacity 2.5s ease-out;
    transition: opacity 2.5s ease-out;
}

.results-area.fade-in-start.fade-in-active,
.results-area.active.fade-in-start.fade-in-active {
    opacity: 1 !important;
}

/* ========================================
   1日1回制限モーダル
   ======================================== */
/* ========================================
   アップデート通知モーダル
   ======================================== */
.update-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 26, 46, 0.95);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10002;
    opacity: 0;
    transition: opacity 0.4s;
}

.update-modal.active {
    display: flex;
    opacity: 1;
}

.update-modal-content {
    text-align: center;
    padding: 40px;
    max-width: 400px;
    background: linear-gradient(145deg, rgba(107, 91, 149, 0.3), rgba(26, 26, 46, 0.8));
    border: 2px solid rgba(212, 175, 55, 0.5);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.update-icon {
    font-size: 4rem;
    margin-bottom: 15px;
    animation: updateBounce 1s ease-in-out infinite;
}

@keyframes updateBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

.update-modal-content h2 {
    font-size: 1.5rem;
    color: var(--text-gold);
    margin-bottom: 15px;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
}

.update-modal-content p {
    font-size: 1rem;
    color: var(--text-light);
    opacity: 0.9;
    line-height: 1.7;
    margin-bottom: 15px;
}

.update-version {
    font-size: 0.9rem;
    color: rgba(212, 175, 55, 0.8);
    margin-bottom: 25px;
    padding: 8px 15px;
    background: rgba(212, 175, 55, 0.1);
    border-radius: 20px;
    display: inline-block;
}

.update-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.update-btn {
    padding: 15px 30px;
    border-radius: 30px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
}

.update-btn.primary {
    background: linear-gradient(135deg, var(--card-purple), var(--primary-color));
    color: white;
    box-shadow: 0 4px 15px rgba(107, 91, 149, 0.4);
}

.update-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(107, 91, 149, 0.6);
}

.update-btn.secondary {
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.update-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

.daily-limit-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 26, 46, 0.95);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10001;
    opacity: 0;
    transition: opacity 0.4s;
}

.daily-limit-modal.active {
    display: flex;
    opacity: 1;
}

.daily-limit-content {
    text-align: center;
    padding: 40px;
    max-width: 500px;
}

.daily-limit-icon {
    font-size: 5rem;
    margin-bottom: 20px;
    animation: gentlePulse 2s ease-in-out infinite;
}

@keyframes gentlePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.daily-limit-content h2 {
    font-size: 1.8rem;
    color: var(--text-gold);
    margin-bottom: 15px;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
}

.daily-limit-content p {
    font-size: 1.1rem;
    color: var(--text-light);
    opacity: 0.9;
    line-height: 1.8;
    margin-bottom: 20px;
}

.todays-card-preview {
    background: linear-gradient(145deg, rgba(107, 91, 149, 0.3), rgba(26, 26, 46, 0.8));
    border: 2px solid rgba(212, 175, 55, 0.5);
    border-radius: 15px;
    padding: 20px;
    margin: 25px 0;
}

.todays-card-preview h4 {
    color: var(--text-gold);
    font-size: 1rem;
    margin-bottom: 10px;
}

.todays-card-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.todays-card-emoji {
    width: 60px;
    height: 90px;
    border-radius: 5px;
    overflow: hidden;
    border: 2px solid var(--card-gold);
}

.todays-card-emoji img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.todays-card-details {
    text-align: left;
}

.todays-card-name {
    font-size: 1.2rem;
    color: var(--text-gold);
    font-weight: 600;
}

.todays-card-orientation {
    font-size: 0.85rem;
    color: var(--card-purple);
}

/* 今日のカードをタップ可能に */
.todays-card-info.card-clickable {
    cursor: pointer;
}

.todays-card-hint {
    font-size: 0.8rem;
    color: rgba(212, 175, 55, 0.7);
    margin-top: 10px;
    animation: hintPulse 2s ease-in-out infinite;
}

@keyframes hintPulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

/* 今日のメッセージボックス */
.todays-message-box {
    background: linear-gradient(145deg, rgba(107, 91, 149, 0.2), rgba(26, 26, 46, 0.6));
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 12px;
    padding: 15px 20px;
    margin-top: 20px;
    text-align: center;
}

.todays-message-box h4 {
    font-size: 0.9rem;
    color: var(--text-gold);
    margin-bottom: 10px;
}

.todays-message-text {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.7;
    font-style: italic;
}

.countdown-text {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 15px;
}

.countdown-time {
    color: var(--text-gold);
    font-weight: 600;
}

.daily-limit-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 25px;
}

.daily-limit-btn {
    padding: 12px 30px;
    border-radius: 25px;
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
}

.daily-limit-btn.primary {
    background: linear-gradient(135deg, var(--card-purple), var(--primary-color));
    border: none;
    color: white;
    box-shadow: 0 5px 20px rgba(155, 89, 182, 0.4);
}

.daily-limit-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(155, 89, 182, 0.6);
}

.daily-limit-btn.secondary {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: var(--text-light);
}

.daily-limit-btn.secondary:hover {
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.1);
}

/* スプレッドカードに「済」バッジ */
.spread-card .daily-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    font-size: 0.7rem;
    padding: 5px 10px;
    border-radius: 15px;
    font-weight: 600;
    box-shadow: 0 3px 10px rgba(46, 204, 113, 0.4);
    display: none;
}

.spread-card.completed .daily-badge {
    display: block;
}

/* 週1回制限バッジ（3枚・5枚スプレッド用） */
.spread-card .weekly-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: linear-gradient(135deg, #3498db, #5dade2);
    color: white;
    font-size: 0.7rem;
    padding: 5px 10px;
    border-radius: 15px;
    font-weight: 600;
    box-shadow: 0 3px 10px rgba(52, 152, 219, 0.4);
    display: none;
}

.spread-card.weekly-completed .weekly-badge {
    display: block;
}

.spread-card.weekly-completed {
    opacity: 0.7;
}

.spread-card.weekly-completed::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(52, 152, 219, 0.1);
    border-radius: 20px;
    pointer-events: none;
}

/* 2週に1回制限バッジ（ケルト十字用） */
.spread-card .biweekly-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: linear-gradient(135deg, #9b59b6, #af7ac5);
    color: white;
    font-size: 0.7rem;
    padding: 5px 10px;
    border-radius: 15px;
    font-weight: 600;
    box-shadow: 0 3px 10px rgba(155, 89, 182, 0.4);
    display: none;
}

.spread-card.biweekly-completed .biweekly-badge {
    display: block;
}

.spread-card.biweekly-completed {
    opacity: 0.7;
}

.spread-card.biweekly-completed::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(155, 89, 182, 0.1);
    border-radius: 20px;
    pointer-events: none;
}

.spread-card.completed {
    opacity: 0.7;
}

.spread-card.completed::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(46, 204, 113, 0.1);
    border-radius: 20px;
    pointer-events: none;
}

/* ========================================
   カード詳細モーダル (愚者の旅)
   ======================================== */
.card-detail-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 20, 0.95);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10002;
    opacity: 0;
    transition: opacity 0.4s;
    padding: 20px;
    overflow-y: auto;
}

.card-detail-modal.active {
    display: flex;
    opacity: 1;
}

.card-detail-content {
    background: linear-gradient(145deg, rgba(45, 27, 78, 0.9), rgba(26, 26, 46, 0.95));
    border: 2px solid rgba(212, 175, 55, 0.5);
    border-radius: 20px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(155, 89, 182, 0.3);
}

.card-detail-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.card-detail-close:hover {
    background: rgba(231, 76, 60, 0.6);
    transform: scale(1.1);
}

.card-detail-header {
    display: flex;
    gap: 20px;
    padding: 25px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.3);
}

.card-detail-image {
    width: 120px;
    height: 180px;
    flex-shrink: 0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    border: 2px solid var(--card-gold);
    position: relative;
}

.card-detail-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-detail-image.reversed img {
    transform: rotate(180deg);
}

.card-detail-title {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.card-detail-number {
    font-size: 0.9rem;
    color: var(--text-gold);
    opacity: 0.8;
    margin-bottom: 5px;
}

.card-detail-name {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-gold);
    margin-bottom: 8px;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
}

.card-detail-orientation {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
}

.card-detail-orientation.upright {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
}

.card-detail-orientation.reversed {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
}

.card-detail-body {
    padding: 25px;
}

.card-detail-section {
    margin-bottom: 25px;
}

.card-detail-section:last-child {
    margin-bottom: 0;
}

.card-detail-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-gold);
    margin-bottom: 12px;
}

.card-detail-section-title .icon {
    font-size: 1.3rem;
}

.card-detail-section-text {
    font-size: 0.95rem;
    color: var(--text-light);
    line-height: 1.8;
    opacity: 0.9;
}

.card-detail-meaning {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.15), rgba(41, 128, 185, 0.1));
    border-left: 3px solid #3498db;
    padding: 15px;
    border-radius: 0 10px 10px 0;
}

.card-detail-meaning.reversed-meaning {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.15), rgba(192, 57, 43, 0.1));
    border-left-color: #e74c3c;
}

.card-detail-lesson {
    background: linear-gradient(135deg, rgba(155, 89, 182, 0.15), rgba(142, 68, 173, 0.1));
    border: 1px solid rgba(155, 89, 182, 0.3);
    padding: 15px;
    border-radius: 10px;
    font-style: italic;
}

/* トリビアボタンとコンテンツ */
.trivia-toggle-btn {
    width: 100%;
    padding: 15px 20px;
    background: linear-gradient(135deg, rgba(241, 196, 15, 0.2), rgba(243, 156, 18, 0.15));
    border: 2px solid rgba(241, 196, 15, 0.4);
    border-radius: 12px;
    color: var(--text-gold);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.trivia-toggle-btn:hover {
    background: linear-gradient(135deg, rgba(241, 196, 15, 0.3), rgba(243, 156, 18, 0.25));
    border-color: rgba(241, 196, 15, 0.6);
    transform: translateY(-2px);
}

.trivia-toggle-btn .arrow {
    transition: transform 0.3s;
}

.trivia-toggle-btn.expanded .arrow {
    transform: rotate(180deg);
}

.trivia-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out;
}

.trivia-content.expanded {
    max-height: 1000px;
}

.trivia-list {
    list-style: none;
    padding: 15px 0 0 0;
    margin: 0;
}

.trivia-list li {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--text-light);
    line-height: 1.6;
    opacity: 0.9;
}

.trivia-list li:last-child {
    margin-bottom: 0;
}

.trivia-list li .trivia-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}

/* ========================================
   カードプレビューオーバーレイ
   （物語モーダル前の大きなカード表示）
   ======================================== */
.card-preview-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, 
        rgba(30, 20, 60, 0.98) 0%,
        rgba(10, 10, 30, 0.99) 100%);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10005;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.card-preview-overlay.active {
    display: flex;
    opacity: 1;
}

.card-preview-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    opacity: 0;
    transform: scale(0.8) translateY(30px);
}

.card-preview-content.revealed {
    opacity: 1;
    transform: scale(1) translateY(0);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.card-preview-position {
    font-size: 1.2rem;
    color: rgba(212, 175, 55, 0.9);
    text-transform: uppercase;
    letter-spacing: 3px;
    opacity: 0;
    transform: translateY(-20px);
}

.card-preview-content.revealed .card-preview-position {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.6s ease-out 0.2s, transform 0.6s ease-out 0.2s;
}

.card-preview-card {
    position: relative;
}

.card-preview-image {
    width: 180px;
    height: 270px;
    border-radius: 12px;
    border: 3px solid rgba(212, 175, 55, 0.7);
    box-shadow: 
        0 0 30px rgba(212, 175, 55, 0.4),
        0 0 60px rgba(155, 89, 182, 0.3),
        0 20px 40px rgba(0, 0, 0, 0.5);
    object-fit: cover;
}

.card-preview-image.reversed {
    transform: rotate(180deg);
}

/* カードが光る演出 */
.card-preview-content.revealed .card-preview-image {
    animation: cardPreviewGlow 1.5s ease-out;
}

@keyframes cardPreviewGlow {
    0% {
        box-shadow: 
            0 0 30px rgba(212, 175, 55, 0.4),
            0 0 60px rgba(155, 89, 182, 0.3),
            0 20px 40px rgba(0, 0, 0, 0.5);
        filter: brightness(1);
    }
    30% {
        box-shadow: 
            0 0 50px rgba(212, 175, 55, 0.9),
            0 0 100px rgba(255, 215, 0, 0.6),
            0 0 150px rgba(155, 89, 182, 0.4),
            0 20px 40px rgba(0, 0, 0, 0.5);
        filter: brightness(1.3);
    }
    100% {
        box-shadow: 
            0 0 30px rgba(212, 175, 55, 0.5),
            0 0 60px rgba(155, 89, 182, 0.3),
            0 20px 40px rgba(0, 0, 0, 0.5);
        filter: brightness(1);
    }
}

.card-preview-name {
    font-size: 1.8rem;
    color: #fff;
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.5);
    opacity: 0;
    transform: translateY(20px);
}

.card-preview-content.revealed .card-preview-name {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.6s ease-out 0.4s, transform 0.6s ease-out 0.4s;
    animation: nameGlow 1.5s ease-out 0.4s;
}

@keyframes nameGlow {
    0% {
        text-shadow: 0 0 20px rgba(212, 175, 55, 0.5);
    }
    30% {
        text-shadow: 
            0 0 30px rgba(212, 175, 55, 0.9),
            0 0 50px rgba(255, 215, 0, 0.6);
    }
    100% {
        text-shadow: 0 0 20px rgba(212, 175, 55, 0.5);
    }
}

.card-preview-reversed {
    font-size: 0.9rem;
    color: rgba(255, 100, 100, 0.8);
    display: none;
    opacity: 0;
}

.card-preview-reversed.show {
    display: block;
}

.card-preview-content.revealed .card-preview-reversed.show {
    opacity: 1;
    transition: opacity 0.6s ease-out 0.5s;
}

/* ========================================
   物語モーダル（3枚のカードが語る物語）
   ======================================== */
.story-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 30, 0.97);
    display: none;
    justify-content: center;
    align-items: flex-start;
    z-index: 10003;
    opacity: 0;
    transition: opacity 0.5s ease;
    padding: 60px 20px 20px;
    overflow-y: auto;
}

.story-modal.active {
    display: flex;
    opacity: 1;
}

.story-modal-content {
    background: linear-gradient(145deg, rgba(30, 20, 60, 0.95), rgba(20, 15, 45, 0.98));
    margin-top: 20px;
    border: 2px solid rgba(212, 175, 55, 0.6);
    border-radius: 25px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 
        0 25px 80px rgba(0, 0, 0, 0.6),
        0 0 60px rgba(155, 89, 182, 0.3),
        inset 0 0 80px rgba(212, 175, 55, 0.05);
    /* スクロールバーを非表示 */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

/* Chrome/Safari用スクロールバー非表示 */
.story-modal-content::-webkit-scrollbar {
    display: none;
}

/* 通常時のモーダル登場アニメーション */
.story-modal-content:not(.with-animation) {
    animation: storyModalAppear 0.6s ease-out;
}

/* キラキラ演出時はBOX自体もフェードイン */
.story-modal-content.with-animation {
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.story-modal-content.with-animation.box-visible {
    opacity: 1;
    transform: scale(1);
}

@keyframes storyModalAppear {
    0% {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.story-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.story-modal-close:hover {
    background: rgba(231, 76, 60, 0.6);
    transform: scale(1.1);
}

.story-modal-header {
    text-align: center;
    padding: 30px 25px 20px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
}

.story-modal-title {
    font-size: 1.4rem;
    color: var(--text-gold);
    margin-bottom: 5px;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
    animation: titleGlow 3s ease-in-out infinite;
}

.story-modal-subtitle {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
}

/* カード画像3枚表示 */
.story-cards-display {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 25px 15px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.2), transparent);
}

.story-card-item {
    text-align: center;
    position: relative;
}

/* カードの光のオーラ演出 */
.story-card-item.with-glow {
    opacity: 0;
    transform: translateY(20px) scale(0.8);
}

.story-card-item.with-glow.card-revealed {
    opacity: 1;
    transform: translateY(0) scale(1);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.story-card-item.with-glow.card-revealed .story-card-image {
    animation: cardGlowPulse 1.5s ease-out;
}

/* 光のオーラエフェクト（カードの後ろ） */
.story-card-item.with-glow::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 90px;
    height: 120px;
    transform: translate(-50%, -50%);
    background: radial-gradient(ellipse, rgba(212, 175, 55, 0.6) 0%, rgba(155, 89, 182, 0.3) 40%, transparent 70%);
    border-radius: 10px;
    opacity: 0;
    z-index: -1;
    pointer-events: none;
}

.story-card-item.with-glow.card-revealed::before {
    animation: auraGlow 1.2s ease-out forwards;
}

/* ラベルも光る */
.story-card-item.with-glow.card-revealed .story-card-label {
    animation: labelGlow 1.5s ease-out forwards;
}

@keyframes cardGlowPulse {
    0% {
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
        filter: brightness(1);
    }
    30% {
        box-shadow: 
            0 0 30px rgba(212, 175, 55, 0.8),
            0 0 60px rgba(255, 215, 0, 0.5),
            0 0 90px rgba(155, 89, 182, 0.3);
        filter: brightness(1.3);
    }
    100% {
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4), 0 0 20px rgba(212, 175, 55, 0.2);
        filter: brightness(1);
    }
}

@keyframes auraGlow {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }
    40% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.2);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1.5);
    }
}

@keyframes labelGlow {
    0% {
        color: rgba(255, 255, 255, 0.7);
        text-shadow: none;
    }
    40% {
        color: #ffd700;
        text-shadow: 0 0 15px rgba(255, 215, 0, 0.8);
    }
    100% {
        color: rgba(212, 175, 55, 1);
        text-shadow: 0 0 8px rgba(212, 175, 55, 0.5);
    }
}

.story-card-image {
    width: 70px;
    height: 105px;
    border-radius: 6px;
    border: 2px solid rgba(212, 175, 55, 0.5);
    object-fit: cover;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s, box-shadow 0.3s;
}

.story-card-image:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 25px rgba(212, 175, 55, 0.3);
}

.story-card-image.reversed {
    transform: rotate(180deg);
}

.story-card-image.reversed:hover {
    transform: rotate(180deg) scale(1.05);
}

.story-card-label {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 8px;
}

/* 物語本文 */
.story-modal-body {
    padding: 25px;
}

.story-text-container {
    background: linear-gradient(135deg, rgba(155, 89, 182, 0.15), rgba(107, 91, 149, 0.1));
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    border-left: 3px solid var(--card-purple);
}

.story-text {
    font-size: 1rem;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.95) !important;
    overflow: visible !important;
}

/* アドバイス */
.story-advice-container {
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.15), rgba(39, 174, 96, 0.1));
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    border-left: 3px solid #2ecc71;
}

.story-advice-title {
    font-size: 0.85rem;
    color: #2ecc71;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.story-advice-text {
    font-size: 0.95rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
    font-style: italic;
}

/* キーワードセクション */
.story-keywords-section {
    border-top: 1px solid rgba(212, 175, 55, 0.2);
    padding-top: 15px;
}

.story-keywords-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.95rem;
    color: rgba(212, 175, 55, 0.9);
    margin-bottom: 12px;
}

/* キーワード */
.story-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    padding: 0 25px 25px;
}

.story-keyword {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.2), rgba(255, 215, 0, 0.1));
    border: 1px solid rgba(212, 175, 55, 0.4);
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 0.8rem;
    color: var(--text-gold);
}

/* 装飾ライン */
.story-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 10px 0;
    color: rgba(212, 175, 55, 0.5);
    font-size: 0.8rem;
}

/* 星と線が一緒に輝くアニメーション */
.story-divider.revealed {
    animation: dividerPulseGlow 3s ease-in-out infinite;
}

@keyframes dividerPulseGlow {
    0%, 100% {
        color: rgba(212, 175, 55, 0.5);
        text-shadow: 0 0 5px rgba(255, 215, 0, 0.3);
    }
    50% {
        color: #ffd700;
        text-shadow: 
            0 0 10px rgba(255, 215, 0, 0.8),
            0 0 20px rgba(255, 215, 0, 0.5);
    }
}

.story-divider::before,
.story-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.3), transparent);
    transition: all 0.3s ease;
}

/* 線も一緒に輝く */
.story-divider.revealed::before,
.story-divider.revealed::after {
    animation: linePulseGlow 3s ease-in-out infinite;
}

@keyframes linePulseGlow {
    0%, 100% {
        background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.3), transparent);
        box-shadow: none;
    }
    50% {
        background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.7), transparent);
        box-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
    }
}

/* レスポンシブ */
@media (max-width: 480px) {
    .story-modal {
        padding: 70px 15px 20px;
    }
}

/* ========================================
   物語モーダル - キラキラ降り注ぐ演出
   ======================================== */
.story-sparkles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10004;
    overflow: hidden;
}

.story-sparkle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: #fff;
    border-radius: 50%;
    opacity: 0;
    will-change: transform, opacity;
}

.story-sparkle.gold {
    background: #ffd700;
    box-shadow: 0 0 10px #ffd700, 0 0 20px rgba(255, 215, 0, 0.6);
}

.story-sparkle.purple {
    background: #9b59b6;
    box-shadow: 0 0 10px #9b59b6, 0 0 20px rgba(155, 89, 182, 0.6);
}

.story-sparkle.white {
    background: #fff;
    box-shadow: 0 0 10px #fff, 0 0 20px rgba(255, 255, 255, 0.6);
}

/* キラキラ落下 - 滑らかに */
.story-sparkle.falling {
    animation: sparkleFall var(--fall-duration, 2s) linear forwards;
}

@keyframes sparkleFall {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(var(--fall-distance, 100vh)) scale(0.3);
    }
}

/* 物語モーダル - 神秘的に現れる演出 */
.story-modal-content.with-animation .story-modal-header,
.story-modal-content.with-animation .story-text-container,
.story-modal-content.with-animation .story-advice-container,
.story-modal-content.with-animation .story-divider,
.story-modal-content.with-animation .story-keywords-section {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.story-modal-content.with-animation .story-modal-header.revealed,
.story-modal-content.with-animation .story-text-container.revealed,
.story-modal-content.with-animation .story-advice-container.revealed,
.story-modal-content.with-animation .story-divider.revealed,
.story-modal-content.with-animation .story-keywords-section.revealed {
    opacity: 1;
    transform: translateY(0);
}

.story-text {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text-light);
}

/* 装飾ラインが光りながら現れる → その後ずっと明滅 */
.story-modal-content.with-animation .story-divider.revealed {
    animation: 
        dividerRevealGlow 1.2s ease-out,
        dividerPulseGlow 3s ease-in-out 1.5s infinite;
}

/* 線も登場後にずっと明滅 */
.story-modal-content.with-animation .story-divider.revealed::before,
.story-modal-content.with-animation .story-divider.revealed::after {
    animation: 
        lineRevealGlow 1.2s ease-out,
        linePulseGlow 3s ease-in-out 1.5s infinite;
}

/* キーワードセクションはキラキラしながら現れる */
.story-modal-content.with-animation .story-keywords-section.revealed {
    animation: keywordsRevealGlow 1.5s ease-out;
}

@keyframes dividerRevealGlow {
    0% {
        opacity: 0;
        color: rgba(212, 175, 55, 0.5);
        text-shadow: none;
    }
    40% {
        opacity: 1;
        color: #ffd700;
        text-shadow: 
            0 0 10px #ffd700,
            0 0 20px #ffd700,
            0 0 30px rgba(255, 215, 0, 0.8),
            0 0 40px rgba(255, 215, 0, 0.5);
    }
    100% {
        color: rgba(212, 175, 55, 0.5);
        text-shadow: 0 0 5px rgba(255, 215, 0, 0.3);
    }
}

/* 登場時の線の輝き */
@keyframes lineRevealGlow {
    0% {
        opacity: 0;
        background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.3), transparent);
    }
    40% {
        opacity: 1;
        background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 1), transparent);
        box-shadow: 0 0 15px rgba(255, 215, 0, 0.8);
    }
    100% {
        background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.3), transparent);
        box-shadow: none;
    }
}

@keyframes keywordsRevealGlow {
    0% {
        filter: brightness(1);
    }
    40% {
        filter: brightness(1.5);
        text-shadow: 0 0 15px rgba(212, 175, 55, 0.8);
    }
    100% {
        filter: brightness(1);
        text-shadow: none;
    }
}

/* 閉じるボタンは常に表示 */
.story-modal-content.with-animation .story-modal-close {
    opacity: 1 !important;
}

/* スクロールヒント（物語モーダル内専用） */
.story-modal-content > .scroll-hint {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    color: rgba(212, 175, 55, 0.8);
    font-size: 0.8rem;
    animation: scrollHintBounce 1.5s ease-in-out infinite;
    transition: opacity 0.5s ease-out;
    z-index: 10;
}

.story-modal-content > .scroll-hint.fade-out {
    opacity: 0;
    pointer-events: none;
}

.scroll-hint-arrow {
    font-size: 1.5rem;
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.6);
}

.scroll-hint-text {
    font-size: 0.7rem;
    letter-spacing: 1px;
}

@keyframes scrollHintBounce {
    0%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    50% {
        transform: translateX(-50%) translateY(8px);
    }
}

/* レスポンシブ - 物語モーダル */
@media (max-width: 480px) {
    .story-modal-content {
        max-width: 95%;
        margin: 10px;
        margin-top: 10px;
    }
    
    .story-card-image {
        width: 60px;
        height: 90px;
    }
    
    .story-modal-title {
        font-size: 1.2rem;
    }
    
    .story-text {
        font-size: 0.95rem;
    }
}

/* カードをタップ可能にするヒント */
.card-tap-hint {
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.65rem;
    color: var(--text-gold);
    opacity: 0;
    white-space: nowrap;
    transition: opacity 0.3s;
}

.tarot-card.flipped .card-tap-hint {
    opacity: 0.7;
}

.tarot-card.flipped:hover .card-tap-hint {
    opacity: 1;
}

.card-clickable {
    cursor: pointer;
}

/* revealedになった後のみhoverエフェクトを適用 */
.card-clickable.revealed:hover,
.card-clickable.first-card:hover,
.card-clickable:not(.scroll-reveal-card):hover {
    transform: scale(1.02);
    transition: transform 0.2s;
}

/* レスポンシブ調整 */
@media (max-width: 480px) {
    .card-detail-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .card-detail-image {
        width: 100px;
        height: 150px;
    }
    
    .card-detail-name {
        font-size: 1.4rem;
    }
    
    .card-detail-body {
        padding: 20px 15px;
    }
}

/* ========================================
   3Dカードビューアー
   ======================================== */
.card-3d-viewer-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 5, 15, 0.98);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10003;
    opacity: 0;
    transition: opacity 0.4s;
}

.card-3d-viewer-modal.active {
    display: flex;
    opacity: 1;
}

.card-3d-container {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1; /* キャンバスは最背面 */
}

.card-3d-container canvas {
    display: block;
}

.card-3d-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100; /* 高いz-index */
}

.card-3d-close:hover {
    background: rgba(231, 76, 60, 0.6);
    border-color: rgba(231, 76, 60, 0.8);
    transform: scale(1.1);
}

/* モバイル用戻るボタン */
.card-3d-back-mobile {
    position: absolute;
    top: 20px;
    left: 20px;
    padding: 12px 24px;
    background: rgba(107, 91, 149, 0.9);
    border: 2px solid rgba(212, 175, 55, 0.6);
    border-radius: 25px;
    color: white;
    font-size: 1rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s;
    z-index: 100; /* 高いz-index */
    display: none; /* PCでは非表示 */
}

.card-3d-back-mobile:hover {
    background: rgba(107, 91, 149, 1);
    border-color: rgba(212, 175, 55, 0.8);
    transform: scale(1.05);
}

.card-3d-controls {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    z-index: 100; /* 高いz-index */
}

.card-3d-btn {
    padding: 12px 20px;
    background: rgba(107, 91, 149, 0.8);
    border: 2px solid rgba(212, 175, 55, 0.5);
    border-radius: 25px;
    color: white;
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-3d-btn:hover {
    background: rgba(107, 91, 149, 1);
    border-color: rgba(212, 175, 55, 0.8);
}

.card-3d-btn.active {
    background: linear-gradient(135deg, var(--card-purple), var(--primary-color));
    border-color: var(--text-gold);
}

.card-3d-instructions {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    padding: 10px 25px;
    border-radius: 20px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.85rem;
    text-align: center;
    z-index: 100; /* 高いz-index */
    pointer-events: none;
}

.card-3d-card-name {
    position: absolute;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--text-gold);
    font-size: 1.2rem;
    font-weight: 600;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
    z-index: 100; /* 高いz-index */
    pointer-events: none;
}

/* カード画像にクリック可能なスタイル追加 */
.card-detail-image {
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}

.card-detail-image:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 40px rgba(155, 89, 182, 0.5), 0 0 30px rgba(212, 175, 55, 0.3);
}

.card-detail-image::after {
    content: '🔍 3D';
    position: absolute;
    bottom: 5px;
    right: 5px;
    background: rgba(0, 0, 0, 0.7);
    color: var(--text-gold);
    font-size: 0.65rem;
    padding: 3px 6px;
    border-radius: 8px;
    opacity: 0;
    transition: opacity 0.3s;
}

.card-detail-image:hover::after {
    opacity: 1;
}

/* タブレット・スマホでの表示切り替え */
@media (max-width: 768px) {
    .card-3d-close {
        display: none !important;
    }
    
    .card-3d-back-mobile {
        display: block !important;
    }
    
    .card-3d-controls {
        bottom: 40px;
    }
    
    .card-3d-card-name {
        bottom: 100px;
    }
    
    .card-3d-instructions {
        top: 70px;
    }
}

/* スマホ用 */
@media (max-width: 480px) {
    .card-3d-instructions {
        font-size: 0.7rem;
        padding: 6px 12px;
        top: 60px;
    }
    
    .card-3d-controls {
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        justify-content: center;
        bottom: 30px;
        padding: 0 5px;
        gap: 6px;
        width: 100%;
    }
    
    .card-3d-btn {
        padding: 8px 10px;
        font-size: 0.7rem;
        white-space: nowrap;
    }
    
    .card-3d-card-name {
        bottom: 80px;
        font-size: 1rem;
    }
    
    .card-3d-back-mobile {
        top: 15px;
        left: 15px;
        padding: 10px 18px;
        font-size: 0.9rem;
    }
}

/* さらに小さい画面用 */
@media (max-width: 380px) {
    .card-3d-controls {
        gap: 4px;
    }
    
    .card-3d-btn {
        padding: 6px 8px;
        font-size: 0.65rem;
    }
    
    .card-3d-card-name {
        font-size: 0.9rem;
    }
}

/* iPhoneのセーフエリア対応 */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .card-3d-controls {
        padding-bottom: env(safe-area-inset-bottom);
    }
}