:root {
    --bg:#0c0a1a;--bg-card:rgba(15,10,30,.8);--gold:#d4a853;--gold-light:#f5e6b8;
    --lavender:#b8a9e8;--violet:#7b5ea7;--rose:#e8a0bf;--text:#ece4f8;
    --font-display:'Cinzel Decorative','Cinzel',serif;--font-heading:'Cinzel',serif;
    --font-body:'Noto Serif JP',serif;--ease:cubic-bezier(.16,1,.3,1);
}
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html,body{height:100%;overflow-x:hidden}
body{background:var(--bg);color:var(--text);font-family:var(--font-body);
    display:flex;justify-content:center;align-items:flex-start;min-height:100vh;overflow-y:auto}

/* ========================================
   Video Background
   ======================================== */
#bg-video {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    pointer-events: none;
    opacity: 0.35;
}

/* ========================================
   ✨ パーティクル・キャンバス
   ======================================== */
#particle-canvas {
    position: fixed;
    inset: 0;
    z-index: 2;
    pointer-events: none;
}

/* ========================================
   🌌 オーロラ背景
   ======================================== */
.aurora-bg {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.aurora-wave {
    position: absolute;
    width: 200%;
    height: 50%;
    bottom: -10%;
    left: -50%;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0;
    animation: auroraFadeIn 3s 1s forwards, auroraFlow 12s infinite ease-in-out;
}

.aurora-wave-1 {
    background: linear-gradient(90deg, transparent, rgba(123, 94, 167, 0.15), rgba(184, 169, 232, 0.1), transparent);
    animation-delay: 0s, 0s;
}

.aurora-wave-2 {
    background: linear-gradient(90deg, transparent, rgba(232, 160, 191, 0.1), rgba(212, 168, 83, 0.08), transparent);
    animation-delay: 1.5s, 4s;
    bottom: 0%;
}

.aurora-wave-3 {
    background: linear-gradient(90deg, transparent, rgba(100, 149, 237, 0.08), rgba(123, 94, 167, 0.1), transparent);
    animation-delay: 3s, 8s;
    bottom: 20%;
    height: 40%;
}

@keyframes auroraFadeIn {
    to { opacity: 1; }
}

@keyframes auroraFlow {
    0%   { transform: translateX(-10%) rotate(-2deg) scale(1); }
    33%  { transform: translateX(5%) rotate(1deg) scale(1.05); }
    66%  { transform: translateX(-5%) rotate(-1deg) scale(0.98); }
    100% { transform: translateX(-10%) rotate(-2deg) scale(1); }
}

/* ========================================
   🪶 浮遊する羽根（常時）
   ======================================== */
.floating-feathers {
    position: fixed;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    overflow: hidden;
}

.float-feather {
    position: absolute;
    pointer-events: none;
    z-index: 5;
    opacity: 0;
    will-change: transform, opacity;
    animation: floatDown linear infinite;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.6));
    color: #fff;
    user-select: none;
}

@keyframes floatDown {
    0% {
        opacity: 0;
        transform: translateY(-10vh) translateX(0) rotate(0deg) scale(0.5);
    }
    10% {
        opacity: 0.8;
    }
    25% {
        transform: translateY(25vh) translateX(30px) rotate(90deg) scale(0.8);
    }
    50% {
        transform: translateY(50vh) translateX(-30px) rotate(180deg) scale(1);
    }
    75% {
        transform: translateY(75vh) translateX(30px) rotate(270deg) scale(0.8);
    }
    90% {
        opacity: 0.4;
    }
    100% {
        opacity: 0;
        transform: translateY(105vh) translateX(-10px) rotate(360deg) scale(0.6);
    }
}

/* ========================================
   背景グロー
   ======================================== */
#stars-canvas{position:fixed;inset:0;z-index:0;pointer-events:none}
.background-effects{position:fixed;inset:0;z-index:1;pointer-events:none;overflow:hidden}
.glow{position:absolute;border-radius:50%;filter:blur(120px);opacity:.35;animation:drift 25s infinite alternate ease-in-out}
.glow-1{width:500px;height:500px;background:var(--violet);top:-120px;left:-80px}
.glow-2{width:400px;height:400px;background:var(--rose);bottom:-100px;right:-60px;animation-delay:-8s}
.glow-3{width:350px;height:350px;background:var(--gold);top:40%;left:50%;transform:translateX(-50%);opacity:.15;animation-delay:-14s}
@keyframes drift{0%{transform:translate(0,0) scale(1)}100%{transform:translate(40px,30px) scale(1.15)}}
.hidden{display:none!important}

/* ========================================
   App
   ======================================== */
#app{position:relative;z-index:10;width:100%;max-width:700px;display:flex;flex-direction:column;align-items:center;padding:0 16px 60px}

/* ========================================
   Phase 1 – Deck
   ======================================== */
#deck-container{min-height:100vh;width:100%;display:flex;flex-direction:column;justify-content:flex-start;align-items:center;padding-top:80px;padding-bottom:40px}
.title-area{text-align:center;margin-bottom:20px}
.pre-title{font-family:var(--font-heading);font-size:.8rem;color:var(--gold);letter-spacing:4px;margin-bottom:8px;animation:shimmer 3s infinite;text-shadow:0 2px 6px rgba(0,0,0,0.8)}
@keyframes shimmer{0%,100%{opacity:.5}50%{opacity:1;text-shadow:0 0 12px var(--gold),0 2px 6px rgba(0,0,0,0.8)}}
.title{font-family:var(--font-display);font-size:clamp(2.2rem,8vw,3.5rem);color:var(--gold-light);
    text-shadow:0 0 30px rgba(212,168,83,.6), 0 4px 12px rgba(0,0,0,0.9), 0 2px 4px rgba(0,0,0,1);letter-spacing:3px}
.subtitle{font-size:.95rem;color:var(--lavender);margin-top:8px;letter-spacing:1px;text-shadow:0 2px 6px rgba(0,0,0,0.8)}

/* デッキパック — 呼吸アニメーション追加 */
.deck-pack{position:relative;width:160px;height:240px;margin:0 auto 16px;cursor:pointer;
    transition:transform .4s var(--ease);animation:breathe 4s infinite ease-in-out}
.deck-pack:hover{transform:translateY(-12px) scale(1.04);animation-play-state:paused}

@keyframes breathe {
    0%, 100% { transform: scale(1) translateY(0); }
    50% { transform: scale(1.02) translateY(-6px); }
}

.pack-inner{width:100%;height:100%;border-radius:16px;overflow:hidden;position:relative;z-index:2;
    box-shadow:0 20px 60px rgba(0,0,0,.5),0 0 40px rgba(212,168,83,.15);border:2px solid rgba(212,168,83,.35)}
.pack-image{width:100%;height:100%;object-fit:cover}
.pack-glow{position:absolute;inset:-20px;background:radial-gradient(circle,rgba(212,168,83,.4) 0%,transparent 70%);
    opacity:0;transition:opacity .5s;z-index:1;border-radius:50%}
.deck-pack:hover .pack-glow{opacity:1}
.feathers{position:absolute;inset:0;z-index:3;pointer-events:none}
.feather{position:absolute;font-size:1.4rem;opacity:0;animation:featherFall 2s forwards ease-out}
@keyframes featherFall{0%{opacity:1;transform:translateY(0) rotate(0) scale(.5)}100%{opacity:0;transform:translateY(-120px) rotate(40deg) scale(1.2)}}
.tap-hint{text-align:center;font-family:var(--font-heading);font-size:.85rem;color:var(--gold);letter-spacing:2px;animation:pulse 2.5s infinite ease-in-out;text-shadow:0 2px 6px rgba(0,0,0,0.8)}
@keyframes pulse{0%,100%{opacity:.4;transform:translateY(0)}50%{opacity:1;transform:translateY(-3px);text-shadow:0 0 8px var(--gold),0 2px 6px rgba(0,0,0,0.8)}}
@keyframes packExplode{0%{transform:scale(1);opacity:1;filter:brightness(1)}40%{transform:scale(1.2);opacity:1;filter:brightness(2.5)}100%{transform:scale(.3) rotate(15deg);opacity:0;filter:brightness(3)}}
.explode-anim{animation:packExplode 1s forwards ease-in}

/* ========================================
   Phase 2 – Card Spread (5枚)
   ======================================== */
#spread-container{width:100%;padding:40px 0;display:flex;flex-direction:column;align-items:center}
.spread-title{text-align:center;font-family:var(--font-heading);color:var(--gold-light);font-size:1.1rem;
    margin-bottom:28px;letter-spacing:2px;text-shadow:0 0 10px rgba(212,168,83,.5), 0 3px 8px rgba(0,0,0,0.9)}
.card-spread{display:flex;justify-content:center;gap:12px;flex-wrap:wrap;width:100%;max-width:650px}

/* 個々のミニカード — ホバーで光の粒子 */
.spread-card{width:110px;height:170px;perspective:800px;cursor:pointer;transition:transform .3s var(--ease), top 0.3s;position:relative;animation: floatCard 3s ease-in-out infinite;}
@keyframes floatCard {
    0% { top: 0; }
    50% { top: -10px; }
    100% { top: 0; }
}
.spread-card:hover{transform:translateY(-14px) scale(1.06); animation-play-state: paused;}
.spread-card::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 14px;
    background: conic-gradient(from var(--card-angle, 0deg), transparent, rgba(212,168,83,0.4), transparent, rgba(184,169,232,0.3), transparent);
    opacity: 0;
    transition: opacity 0.4s;
    z-index: 0;
    animation: rotateGlow 4s linear infinite;
}
.spread-card:hover::after {
    opacity: 1;
}

@property --card-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

@keyframes rotateGlow {
    to { --card-angle: 360deg; }
}

.spread-card .card-inner{width:100%;height:100%;border-radius:12px;overflow:hidden;position:relative;z-index:1;
    border:2px solid rgba(212,168,83,.3);box-shadow:0 8px 25px rgba(0,0,0,.5),0 0 15px rgba(212,168,83,.1);
    transition:box-shadow .3s,border-color .3s}
.spread-card:hover .card-inner{border-color:var(--gold);box-shadow:0 12px 35px rgba(0,0,0,.6),0 0 25px rgba(212,168,83,.3)}
.spread-card .card-inner img{width:100%;height:100%;object-fit:cover}
.spread-card.selected{pointer-events:none;transform:translateY(-20px) scale(1.08) !important;animation:floatSelectedCard 2.5s ease-in-out infinite !important;z-index:50}
.spread-card.selected .card-inner{border-color:var(--gold);box-shadow:0 0 50px rgba(212,168,83,.8)}

@keyframes floatSelectedCard {
    0%, 100% { transform: translateY(-20px) scale(1.08); }
    50% { transform: translateY(-30px) scale(1.08); }
}

/* 選択時のバースト */
.spread-card.selected::before {
    content: '✦';
    position: absolute;
    top: 50%;
    left: 50%;
    font-size: 3rem;
    color: var(--gold);
    transform: translate(-50%, -50%) scale(0);
    animation: selectBurst 0.8s forwards ease-out;
    z-index: 10;
    text-shadow: 0 0 20px var(--gold), 0 0 40px rgba(212,168,83,0.5);
}

@keyframes selectBurst {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 1; }
    50% { transform: translate(-50%, -50%) scale(2); opacity: 0.8; }
    100% { transform: translate(-50%, -50%) scale(3); opacity: 0; }
}

.spread-card.not-selected{pointer-events:none;animation:fadeOutCard .6s forwards ease-in}
@keyframes fadeOutCard{to{opacity:0;transform:scale(.8) translateY(20px)}}

/* ========================================
   Phase 3 – Reveal
   ======================================== */
#reveal-container{width:100%;padding:30px 0;display:flex;flex-direction:column;align-items:center}

.reveal-card-scene{
    width:220px;height:330px;perspective:1200px;margin:0 auto 24px;flex-shrink:0;
    position: relative;
}

/* 魔法陣 */
.magic-circle {
    position: absolute;
    width: 300px;
    height: 300px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 1.5s ease;
}

.magic-circle.active {
    opacity: 1;
}

.magic-circle-svg {
    width: 100%;
    height: 100%;
    animation: magicRotate 20s linear infinite;
    filter: drop-shadow(0 0 8px rgba(212, 168, 83, 0.4));
}

@keyframes magicRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.magic-circle.active .magic-circle-svg {
    animation: magicRotate 20s linear infinite, magicPulse 3s ease-in-out infinite;
}

@keyframes magicPulse {
    0%, 100% { filter: drop-shadow(0 0 8px rgba(212, 168, 83, 0.4)); transform: rotate(var(--r, 0deg)) scale(1); }
    50% { filter: drop-shadow(0 0 20px rgba(212, 168, 83, 0.7)); transform: rotate(var(--r, 0deg)) scale(1.05); }
}

/* 神聖光線 */
.divine-rays {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 0;
    pointer-events: none;
    overflow: visible;
}

.divine-ray {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2px;
    height: 0;
    transform-origin: top center;
    opacity: 0;
    background: linear-gradient(to bottom, rgba(212, 168, 83, 0.8), rgba(245, 230, 184, 0.2), transparent);
    filter: blur(1px);
}

.divine-ray.active {
    animation: rayShoot 2s forwards ease-out;
}

@keyframes rayShoot {
    0% {
        height: 0;
        opacity: 0;
    }
    20% {
        opacity: 0.8;
    }
    60% {
        height: 200px;
        opacity: 0.5;
    }
    100% {
        height: 300px;
        opacity: 0;
    }
}

/* カード */
.card{width:100%;height:100%;position:relative;transition:transform 1.4s var(--ease);transform-style:preserve-3d;cursor:default;z-index:2}
.card.is-flipped{transform:rotateY(180deg)}
.card.is-reversed.is-flipped{transform:rotateY(180deg) rotateZ(180deg)}
.card__face{position:absolute;width:100%;height:100%;backface-visibility:hidden;border-radius:16px;overflow:hidden;
    box-shadow:0 12px 40px rgba(0,0,0,.7),0 0 20px rgba(212,168,83,.15);border:2px solid rgba(212,168,83,.3)}
.card__face--back{transform:rotateY(0)}
.card__face--front{transform:rotateY(180deg);position:relative}
.card-art{width:100%;height:100%;object-fit:cover;display:block}
.card-overlay{position:absolute;bottom:0;left:0;right:0;padding:12px;
    background:linear-gradient(transparent,rgba(10,5,25,.85));display:flex;flex-direction:column;align-items:center;gap:2px}
.card-number{font-family:var(--font-heading);font-size:1rem;color:var(--gold)}
.card-name{font-family:var(--font-heading);font-size:1.1rem;color:var(--gold-light);text-shadow:0 1px 6px rgba(0,0,0,.6)}

/* フリップ後のカードグロー */
.card.is-flipped .card__face--front {
    animation: cardGlow 3s ease-in-out infinite;
}

@keyframes cardGlow {
    0%, 100% { box-shadow: 0 12px 40px rgba(0,0,0,.7), 0 0 20px rgba(212,168,83,.15); }
    50% { box-shadow: 0 12px 40px rgba(0,0,0,.7), 0 0 40px rgba(212,168,83,.4), 0 0 80px rgba(212,168,83,.15); }
}

/* ========================================
   Reading Result Container
   ======================================== */
.reading-result{width:100%;max-width:480px;background:rgba(12, 10, 26, 0.4);backdrop-filter:blur(24px);-webkit-backdrop-filter:blur(24px);
    border:1px solid rgba(212,168,83,.25);border-radius:20px;padding:24px;min-height:100px;display:flex;flex-direction:column;gap:16px;
    box-shadow:0 15px 35px rgba(0,0,0,0.4), inset 0 0 20px rgba(212,168,83,0.05);
    position:relative;overflow:hidden;}

/* 結果テキスト表示アニメーション向上 */
.reading-result::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent, rgba(212,168,83,0.05), transparent, rgba(184,169,232,0.03), transparent);
    animation: resultShine 8s linear infinite;
    pointer-events: none;
}

@keyframes resultShine {
    to { transform: rotate(360deg); }
}

.result-text {
    font-size: 0.95rem;
    line-height: 1.8;
    color: var(--text);
    opacity: 0;
    transform: translateY(10px);
    transition: all 1.2s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    z-index: 1;
}
.result-text.visible {
    opacity: 1;
    transform: translateY(0);
}

.loading-indicator{display:flex;flex-direction:column;align-items:center;gap:12px;padding:10px 0}
.angel-loading{display:flex;align-items:center;gap:8px;font-family:var(--font-heading);font-size:.9rem;color:var(--lavender)}
.wing-l{animation:wingFlap 1.2s infinite ease-in-out;display:inline-block}
.wing-r{animation:wingFlap 1.2s infinite ease-in-out .6s;display:inline-block}
@keyframes wingFlap{0%,100%{transform:rotate(-10deg) scale(1)}50%{transform:rotate(10deg) scale(1.15)}}
.spinner{width:24px;height:24px;border:3px solid rgba(212,168,83,.2);border-top-color:var(--gold);border-radius:50%;animation:spin .9s infinite linear}
@keyframes spin{100%{transform:rotate(360deg)}}

/* ========================================
   Retry
   ======================================== */
.retry-btn{margin-top:16px;font-family:var(--font-heading);font-size:.95rem;color:var(--gold-light);
    background:rgba(212,168,83,.12);border:1px solid rgba(212,168,83,.35);border-radius:50px;padding:12px 32px;
    cursor:pointer;transition:all .3s ease;letter-spacing:1px;align-self:center;
    position:relative;overflow:hidden}

.retry-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(212,168,83,0.2), transparent);
    transition: left 0.6s;
}

.retry-btn:hover::before {
    left: 100%;
}

.retry-btn:hover{background:rgba(212,168,83,.25);box-shadow:0 0 20px rgba(212,168,83,.2);transform:translateY(-2px)}

/* ========================================
   ⭐ キラキラ星粒子 (CSS版)
   ======================================== */
.sparkle {
    position: fixed;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 4;
    background: var(--gold);
    animation: sparkleAnim var(--duration, 3s) var(--delay, 0s) infinite ease-in-out;
    box-shadow: 0 0 6px rgba(212, 168, 83, 0.6), 0 0 12px rgba(212, 168, 83, 0.3);
}

@keyframes sparkleAnim {
    0%, 100% { opacity: 0; transform: scale(0.5) translateY(0); }
    20% { opacity: 1; transform: scale(1) translateY(-10px); }
    80% { opacity: 0.6; transform: scale(0.8) translateY(-30px); }
}

/* ========================================
   Animations
   ======================================== */
@keyframes fadeInSlide{0%{opacity:0;transform:translateY(40px)}100%{opacity:1;transform:translateY(0)}}
.fade-in-slide{animation:fadeInSlide .9s forwards var(--ease)}
@keyframes cardDeal{0%{opacity:0;transform:translateY(-60px) scale(.7) rotate(-5deg)}100%{opacity:1;transform:translateY(0) scale(1) rotate(0)}}
.deal-anim{animation:cardDeal .5s forwards var(--ease), floatCard 3s ease-in-out infinite}

/* ========================================
   ✨ 画面フラッシュ
   ======================================== */
.screen-flash {
    position: fixed;
    inset: 0;
    z-index: 100;
    pointer-events: none;
    background: radial-gradient(circle at center, rgba(245,230,184,0.6), rgba(212,168,83,0.2), transparent 70%);
    opacity: 0;
    animation: flashBang 1.2s forwards ease-out;
}

@keyframes flashBang {
    0% { opacity: 0; }
    15% { opacity: 1; }
    100% { opacity: 0; }
}

/* ========================================
   ✨ Reveal Scene (Phase 3)
   ======================================== */
.reveal-card-scene {
    position: relative;
    width: 100%;
    max-width: 600px;
    min-height: 400px;
    margin: 0 auto 30px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.card-spread {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    perspective: 1000px;
}

.selection-progress {
    text-align: center;
    margin-top: 24px;
    font-size: 1.1rem;
    color: var(--lavender);
    font-family: var(--font-heading);
    letter-spacing: 1px;
}

.selection-progress span {
    color: var(--gold-light);
    font-size: 1.3rem;
    font-weight: bold;
}

.revealed-cards-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
    perspective: 1000px;
}

/* ========== ケルト十字レイアウト ========== */
.celtic-cross-layout {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 0.5fr 1fr;
    grid-template-rows: repeat(4, auto);
    gap: 15px;
    max-width: 900px;
    margin: 0 auto 30px;
}

/* 各カードの配置指定 */
.celtic-cross-layout .revealed-card-wrapper:nth-child(1) { grid-column: 2; grid-row: 2; z-index: 1; }
.celtic-cross-layout .revealed-card-wrapper:nth-child(2) { grid-column: 2; grid-row: 2; z-index: 2; transform: rotate(90deg) scale(0.9); }
.celtic-cross-layout .revealed-card-wrapper:nth-child(3) { grid-column: 2; grid-row: 1; }
.celtic-cross-layout .revealed-card-wrapper:nth-child(4) { grid-column: 2; grid-row: 3; }
.celtic-cross-layout .revealed-card-wrapper:nth-child(5) { grid-column: 1; grid-row: 2; }
.celtic-cross-layout .revealed-card-wrapper:nth-child(6) { grid-column: 3; grid-row: 2; }
.celtic-cross-layout .revealed-card-wrapper:nth-child(7) { grid-column: 5; grid-row: 4; }
.celtic-cross-layout .revealed-card-wrapper:nth-child(8) { grid-column: 5; grid-row: 3; }
.celtic-cross-layout .revealed-card-wrapper:nth-child(9) { grid-column: 5; grid-row: 2; }
.celtic-cross-layout .revealed-card-wrapper:nth-child(10) { grid-column: 5; grid-row: 1; }

/* ========== ヘキサグラム相性レイアウト ========== */
.hexagram-layout {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: auto auto auto auto;
    gap: 15px;
    max-width: 600px;
    margin: 0 auto 30px;
    justify-items: center;
}

.hexagram-layout .revealed-card-wrapper:nth-child(6) { grid-column: 2; grid-row: 1; }
.hexagram-layout .revealed-card-wrapper:nth-child(1) { grid-column: 1; grid-row: 2; }
.hexagram-layout .revealed-card-wrapper:nth-child(2) { grid-column: 3; grid-row: 2; }
.hexagram-layout .revealed-card-wrapper:nth-child(7) { grid-column: 2; grid-row: 2; transform: scale(1.1); z-index: 2; }
.hexagram-layout .revealed-card-wrapper:nth-child(4) { grid-column: 1; grid-row: 3; }
.hexagram-layout .revealed-card-wrapper:nth-child(5) { grid-column: 3; grid-row: 3; }
.hexagram-layout .revealed-card-wrapper:nth-child(3) { grid-column: 2; grid-row: 4; }

@media (max-width: 768px) {
    .celtic-cross-layout {
        display: flex; /* スマホでは縦並びにフォールバック */
        flex-direction: column;
        align-items: center;
    }
    .celtic-cross-layout .revealed-card-wrapper:nth-child(2) {
        transform: none; /* スマホでは回転を解除 */
    }
}

.revealed-card-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.card-position-label {
    font-family: var(--font-heading);
    font-size: 1rem;
    color: var(--gold-light);
    background: rgba(15, 10, 30, 0.8);
    padding: 4px 16px;
    border-radius: 20px;
    border: 1px solid rgba(212, 168, 83, 0.5);
    box-shadow: 0 0 10px rgba(212, 168, 83, 0.2);
    animation: fadeInSlide 0.5s ease forwards;
    opacity: 0;
}

.card.revealed-card {
    width: 180px;
    height: 310px;
    cursor: default;
}

/* ========================================
   🔮 アプリヘッダー & カウンター
   ======================================== */
.app-header {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: fadeInSlide 0.8s ease forwards;
}

.usage-counter {
    position: relative;
}

.auth-btn {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    color: var(--text);
    background: rgba(12, 10, 26, 0.6);
    border: 1px solid rgba(184, 169, 232, 0.4);
    padding: 8px 16px;
    border-radius: 50px;
    cursor: pointer;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: all 0.3s ease;
}

.auth-btn:hover {
    background: rgba(184, 169, 232, 0.15);
    border-color: rgba(184, 169, 232, 0.8);
    transform: translateY(-2px);
}

.usage-counter-inner {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(12, 10, 26, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(212, 168, 83, 0.3);
    border-radius: 50px;
    font-family: var(--font-heading);
    font-size: 0.85rem;
    color: var(--gold-light);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: all 0.4s ease;
}

.usage-counter.is-premium .usage-counter-inner {
    border-color: rgba(184, 169, 232, 0.5);
    background: linear-gradient(135deg, rgba(123, 94, 167, 0.3), rgba(12, 10, 26, 0.6));
    box-shadow: 0 4px 20px rgba(123, 94, 167, 0.2);
}

.usage-counter.is-depleted .usage-counter-inner {
    border-color: rgba(232, 160, 191, 0.4);
    color: var(--rose);
}

.usage-icon { font-size: 1rem; }
.usage-text strong { font-size: 1.1rem; }

/* 画像アイコン用スタイル */
.icon-tiny {
    width: 20px;
    height: 20px;
    object-fit: contain;
    vertical-align: middle;
}

.icon-modal {
    width: 60px;
    height: 60px;
    object-fit: contain;
    margin-bottom: 15px;
    filter: drop-shadow(0 0 10px rgba(212, 168, 83, 0.5));
}

.title-area {
    text-align: center;
    margin-bottom: 24px;
}

/* ========================================
   ⚙️ 占い設定UI
   ======================================== */
.reading-settings {
    background: rgba(15, 10, 30, 0.6);
    border: 1px solid rgba(212, 168, 83, 0.3);
    border-radius: 16px;
    padding: 16px 20px;
    margin: 0 auto 20px;
    max-width: 460px;
    width: 100%;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    z-index: 10;
}

.setting-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.setting-group label {
    font-size: 0.9rem;
    color: var(--gold-light);
    font-family: var(--font-heading);
    letter-spacing: 1px;
}

.setting-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.setting-btn {
    background: rgba(12, 10, 26, 0.8);
    border: 1px solid rgba(184, 169, 232, 0.3);
    color: var(--lavender);
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: var(--font-body);
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.setting-btn:hover {
    border-color: var(--lavender);
    background: rgba(184, 169, 232, 0.1);
}

.setting-btn.active {
    background: rgba(184, 169, 232, 0.25);
    border-color: var(--gold-light);
    color: var(--gold-light);
    box-shadow: inset 0 0 10px rgba(212, 168, 83, 0.2);
}

.setting-textarea,
.setting-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(184, 169, 232, 0.3);
    border-radius: 8px;
    padding: 10px 14px;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 0.9rem;
    resize: vertical;
    transition: all 0.3s;
}

.setting-textarea:focus,
.setting-input:focus {
    outline: none;
    border-color: var(--gold-light);
    background: rgba(255, 255, 255, 0.1);
}

.premium-lock {
    font-size: 0.85rem;
    margin-left: 4px;
}

/* ========================================
   🎴 Deck Pack
   ======================================== */
.deck-pack {
    max-width: 400px;
}

/* ========================================
   👼 プレミアムティーザー（結果下部）
   ======================================== */
.premium-teaser {
    position: relative;
    padding: 16px;
    margin-top: 8px;
    background: linear-gradient(135deg, rgba(123, 94, 167, 0.15), rgba(212, 168, 83, 0.1));
    border: 1px solid rgba(184, 169, 232, 0.25);
    border-radius: 14px;
    text-align: center;
    overflow: hidden;
    z-index: 1;
}

.premium-teaser-glow {
    position: absolute;
    inset: 0;
    background: conic-gradient(from 0deg, transparent, rgba(212, 168, 83, 0.08), transparent, rgba(184, 169, 232, 0.06), transparent);
    animation: resultShine 6s linear infinite;
    pointer-events: none;
}

.premium-teaser-text {
    font-size: 0.85rem;
    color: var(--lavender);
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
}

.premium-teaser-btn {
    font-family: var(--font-heading);
    font-size: 0.8rem;
    color: var(--gold-light);
    background: rgba(212, 168, 83, 0.15);
    border: 1px solid rgba(212, 168, 83, 0.3);
    border-radius: 50px;
    padding: 8px 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.premium-teaser-btn:hover {
    background: rgba(212, 168, 83, 0.25);
    box-shadow: 0 0 15px rgba(212, 168, 83, 0.2);
}

/* ========================================
   📤 シェアセクション
   ======================================== */
.share-section {
    width: 100%;
    max-width: 480px;
    text-align: center;
    margin-top: 16px;
    animation: fadeInSlide 0.6s ease forwards;
}

.share-label {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    color: var(--gold);
    letter-spacing: 1px;
    margin-bottom: 12px;
    opacity: 0.8;
}

.share-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 10px;
}

.share-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(212, 168, 83, 0.3);
    background: rgba(12, 10, 26, 0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--gold-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.share-btn:hover {
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 6px 20px rgba(212, 168, 83, 0.25);
}

.share-x:hover { background: rgba(29, 161, 242, 0.2); border-color: rgba(29, 161, 242, 0.5); }
.share-btn.share-fb:hover {
    background: rgba(24, 119, 242, 0.2);
    border-color: rgba(24, 119, 242, 0.8);
    color: #1877f2;
}

.share-btn.share-threads:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.8);
    color: #fff;
}

.share-btn.share-line:hover { background: rgba(6, 199, 85, 0.2); border-color: rgba(6, 199, 85, 0.5); }
.share-copy:hover { background: rgba(212, 168, 83, 0.2); }

.share-bonus-hint {
    font-size: 0.75rem;
    color: var(--lavender);
    opacity: 0.7;
    animation: pulse 3s infinite ease-in-out;
}

/* ========================================
   🌙 制限到達オーバーレイ
   ======================================== */
.limit-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(12, 10, 26, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    animation: fadeIn 0.5s ease forwards;
    padding: 20px;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.limit-card {
    max-width: 400px;
    width: 100%;
    background: rgba(20, 15, 40, 0.8);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(212, 168, 83, 0.3);
    border-radius: 24px;
    padding: 40px 30px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), inset 0 0 40px rgba(212, 168, 83, 0.05);
    animation: fadeInSlide 0.6s ease forwards;
}

.limit-image-container {
    margin-bottom: 20px;
}

.angel-sorry-img {
    width: 140px;
    height: 140px;
    object-fit: contain;
    filter: drop-shadow(0 0 10px rgba(212, 168, 83, 0.3));
    animation: floating 3s ease-in-out infinite;
}

.limit-title {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: var(--gold-light);
    margin-bottom: 8px;
}

.limit-message {
    font-size: 0.9rem;
    color: var(--lavender);
    margin-bottom: 24px;
    opacity: 0.8;
}

.limit-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 24px;
}

.limit-ad-btn,
.limit-share-btn,
.limit-premium-btn {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    padding: 14px 24px;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    letter-spacing: 0.5px;
}

.limit-ad-btn {
    color: var(--text);
    background: rgba(184, 169, 232, 0.15);
    border: 1px solid rgba(184, 169, 232, 0.4);
}

.limit-ad-btn:hover:not(:disabled) {
    background: rgba(184, 169, 232, 0.3);
    box-shadow: 0 0 20px rgba(184, 169, 232, 0.2);
    transform: translateY(-2px);
}

.limit-ad-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.limit-share-btn {
    color: var(--gold-light);
    background: rgba(212, 168, 83, 0.12);
    border: 1px solid rgba(212, 168, 83, 0.35);
}

.limit-share-btn:hover {
    background: rgba(212, 168, 83, 0.25);
    box-shadow: 0 0 20px rgba(212, 168, 83, 0.2);
    transform: translateY(-2px);
}

.limit-premium-btn {
    color: #fff;
    background: linear-gradient(135deg, rgba(123, 94, 167, 0.6), rgba(184, 169, 232, 0.4));
    border: 1px solid rgba(184, 169, 232, 0.5);
}

.limit-premium-btn:hover {
    background: linear-gradient(135deg, rgba(123, 94, 167, 0.8), rgba(184, 169, 232, 0.6));
    box-shadow: 0 0 25px rgba(184, 169, 232, 0.3);
    transform: translateY(-2px);
}

.limit-timer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    color: var(--text);
    opacity: 0.6;
}

.limit-countdown {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--gold);
    letter-spacing: 3px;
}

/* ========================================
   👼 プレミアムモーダル
   ======================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(12, 10, 26, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    animation: fadeIn 0.4s ease forwards;
    padding: 20px;
}

.premium-modal {
    max-width: 440px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    background: rgba(20, 15, 40, 0.9);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(212, 168, 83, 0.35);
    border-radius: 24px;
    position: relative;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6), 0 0 40px rgba(212, 168, 83, 0.1);
    animation: fadeInSlide 0.5s ease forwards;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(212, 168, 83, 0.2);
    background: rgba(12, 10, 26, 0.5);
    color: var(--text);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    z-index: 10;
}

.modal-close:hover {
    background: rgba(212, 168, 83, 0.2);
    transform: rotate(90deg);
}

.modal-content { padding: 36px 28px 28px; }

.modal-header {
    text-align: center;
    margin-bottom: 28px;
}

.modal-icon { font-size: 3rem; margin-bottom: 12px; }

.modal-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--gold-light);
    text-shadow: 0 0 20px rgba(212, 168, 83, 0.4);
    margin-bottom: 6px;
}

.modal-subtitle {
    font-size: 0.9rem;
    color: var(--lavender);
    opacity: 0.8;
}

.modal-features {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 28px;
}

.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    background: rgba(212, 168, 83, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(212, 168, 83, 0.1);
    transition: border-color 0.3s;
}

.feature-item:hover { border-color: rgba(212, 168, 83, 0.25); }
.feature-icon { font-size: 1.3rem; flex-shrink: 0; margin-top: 2px; }

.feature-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.feature-text strong {
    font-size: 0.9rem;
    color: var(--gold-light);
}

.feature-text span:last-child {
    font-size: 0.78rem;
    color: var(--text);
    opacity: 0.65;
}

.modal-pricing {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.price-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 18px 12px;
    border-radius: 16px;
    border: 1px solid rgba(212, 168, 83, 0.2);
    background: rgba(212, 168, 83, 0.05);
    transition: all 0.3s;
    cursor: pointer;
    position: relative;
}

.price-card:hover {
    border-color: rgba(212, 168, 83, 0.4);
    transform: translateY(-2px);
}

.price-card.selected {
    border-color: var(--gold-light);
    background: rgba(212, 168, 83, 0.15);
    box-shadow: 0 0 20px rgba(212, 168, 83, 0.25);
    transform: translateY(-2px);
}

.price-card.popular {
    border-color: rgba(184, 169, 232, 0.4);
    background: linear-gradient(135deg, rgba(123, 94, 167, 0.15), rgba(184, 169, 232, 0.08));
}

.price-card.popular.selected {
    border-color: var(--lavender);
    background: linear-gradient(135deg, rgba(123, 94, 167, 0.3), rgba(184, 169, 232, 0.15));
    box-shadow: 0 0 20px rgba(184, 169, 232, 0.3);
}

.popular-badge {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.65rem;
    padding: 2px 10px;
    border-radius: 50px;
    background: linear-gradient(135deg, var(--violet), var(--lavender));
    color: #fff;
    white-space: nowrap;
}

.price-label {
    font-size: 0.75rem;
    color: var(--text);
    opacity: 0.6;
}

.price-amount {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    color: var(--gold-light);
}

.price-amount small {
    font-size: 0.7rem;
    opacity: 0.7;
}

.price-per-month {
    font-size: 0.7rem;
    color: var(--lavender);
    opacity: 0.7;
}

.modal-coming-soon {
    text-align: center;
    font-family: var(--font-heading);
    font-size: 0.8rem;
    color: var(--lavender);
    margin-bottom: 16px;
    opacity: 0.7;
}

.modal-cta-btn {
    width: 100%;
    font-family: var(--font-heading);
    font-size: 0.95rem;
    color: var(--text);
    background: linear-gradient(135deg, rgba(123, 94, 167, 0.3), rgba(212, 168, 83, 0.2));
    border: 1px solid rgba(212, 168, 83, 0.3);
    border-radius: 50px;
    padding: 14px 24px;
    cursor: pointer;
    letter-spacing: 1px;
    transition: all 0.3s;
}

.modal-cta-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, rgba(123, 94, 167, 0.5), rgba(212, 168, 83, 0.4));
    box-shadow: 0 0 15px rgba(212, 168, 83, 0.2);
}

.modal-cta-btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

/* ========================================
   📜 フッター
   ======================================== */
.app-footer {
    text-align: center;
    padding: 20px;
    margin-top: 40px;
    border-top: 1px solid rgba(212, 168, 83, 0.2);
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
    z-index: 10;
    width: 100%;
}

.footer-link {
    color: var(--gold-light);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.3s;
}

.footer-link:hover {
    color: var(--gold);
}

.footer-copy {
    color: var(--text);
    opacity: 0.5;
    font-size: 0.75rem;
}

/* ========================================
   👤 マイページ
   ======================================== */
.mypage-modal {
    max-width: 640px;
    max-height: 85vh;
    overflow-y: auto;
}

.mypage-plan-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    margin-top: 8px;
    background: rgba(212, 168, 83, 0.2);
    color: var(--gold-light);
    border: 1px solid rgba(212, 168, 83, 0.4);
}

.mypage-section {
    margin-bottom: 24px;
    text-align: left;
}

.mypage-section h3 {
    font-size: 1.1rem;
    color: var(--lavender);
    margin-bottom: 16px;
    border-bottom: 1px solid rgba(184, 169, 232, 0.3);
    padding-bottom: 8px;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.history-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(212, 168, 83, 0.15);
    border-radius: 12px;
    padding: 16px;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.history-date {
    font-size: 0.8rem;
    color: var(--lavender);
    opacity: 0.8;
}

.history-badge {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(123, 94, 167, 0.3);
    color: #fff;
}

.history-card {
    font-family: var(--font-heading);
    font-size: 1rem;
    color: var(--gold-light);
    margin-bottom: 12px;
}

.history-reading {
    font-size: 0.9rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
}

.history-empty {
    text-align: center;
    color: var(--lavender);
    opacity: 0.7;
    font-size: 0.9rem;
    padding: 20px 0;
}

/* カレンダー連携機能 */
.history-actions {
    margin-top: 16px;
    display: flex;
    justify-content: flex-end;
    position: relative;
}

.calendar-btn {
    background: rgba(184, 169, 232, 0.15);
    border: 1px solid rgba(184, 169, 232, 0.4);
    color: var(--lavender);
    font-family: var(--font-body);
    font-size: 0.8rem;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.calendar-btn:hover {
    background: rgba(184, 169, 232, 0.25);
    color: #fff;
    border-color: rgba(184, 169, 232, 0.8);
}

.calendar-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: rgba(15, 10, 30, 0.95);
    border: 1px solid rgba(212, 168, 83, 0.3);
    border-radius: 8px;
    padding: 8px 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    z-index: 100;
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-5px);
    transition: all 0.2s;
    backdrop-filter: blur(10px);
}

.calendar-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.calendar-option {
    display: block;
    width: 100%;
    text-align: left;
    padding: 10px 16px;
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 0.85rem;
    cursor: pointer;
    font-family: var(--font-body);
}

.calendar-option:hover {
    background: rgba(212, 168, 83, 0.15);
    color: var(--gold-light);
}

.mypage-logout-btn {
    width: 100%;
    padding: 12px;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text);
    font-family: var(--font-heading);
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 10px;
}

.mypage-logout-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* ========================================
   🔐 認証フォーム
   ======================================== */
.auth-modal {
    max-width: 400px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
}

.input-group label {
    font-size: 0.85rem;
    color: var(--lavender);
}

.input-group input {
    background: rgba(12, 10, 26, 0.5);
    border: 1px solid rgba(212, 168, 83, 0.3);
    padding: 12px 16px;
    border-radius: 8px;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s;
}

.input-group input:focus {
    border-color: var(--gold-light);
    box-shadow: 0 0 10px rgba(212, 168, 83, 0.2);
}

.auth-error {
    color: var(--rose);
    font-size: 0.85rem;
    text-align: center;
}

.auth-switch {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text);
    opacity: 0.8;
}

.auth-switch a {
    color: var(--gold-light);
    text-decoration: none;
    margin-left: 6px;
    font-family: var(--font-heading);
}

.auth-switch a:hover {
    text-decoration: underline;
}

/* ========================================
   📚 履歴フィルターとお気に入り
   ======================================== */
.history-tabs {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
}

.history-tab {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(184, 169, 232, 0.3);
    color: var(--lavender);
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s;
}

.history-tab:hover {
    background: rgba(184, 169, 232, 0.15);
}

.history-tab.active {
    background: rgba(212, 168, 83, 0.2);
    border-color: var(--gold-light);
    color: var(--gold-light);
}

.history-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.favorite-btn {
    background: none;
    border: none;
    color: rgba(212, 168, 83, 0.4);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s;
    padding: 0;
}

.favorite-btn.active {
    color: var(--gold-light);
    text-shadow: 0 0 8px var(--gold);
}

.favorite-btn:hover {
    transform: scale(1.1);
}

/* ========================================
   💬 深掘りチャット (Premium)
   ======================================== */
.history-chat-section {
    background: rgba(12, 10, 26, 0.4);
    border: 1px solid rgba(184, 169, 232, 0.2);
    border-radius: 12px;
    padding: 12px;
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-history {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 250px;
    overflow-y: auto;
    padding-right: 4px;
}

.chat-msg {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.chat-msg.user {
    flex-direction: row-reverse;
}

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

.chat-bubble {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    color: var(--text);
    max-width: 85%;
    line-height: 1.5;
}

.chat-msg.user .chat-bubble {
    background: rgba(184, 169, 232, 0.15);
    border-color: rgba(184, 169, 232, 0.3);
}

.chat-msg.assistant .chat-bubble {
    background: rgba(212, 168, 83, 0.1);
    border-color: rgba(212, 168, 83, 0.25);
    color: var(--gold-light);
}

.chat-input-area {
    display: flex;
    gap: 8px;
}

.chat-input-area input {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(184, 169, 232, 0.3);
    border-radius: 50px;
    padding: 8px 16px;
    color: var(--text);
    outline: none;
    font-size: 0.85rem;
}

.chat-input-area input:focus {
    border-color: var(--gold-light);
}

.chat-send-btn {
    background: rgba(212, 168, 83, 0.2);
    border: 1px solid rgba(212, 168, 83, 0.5);
    color: var(--gold-light);
    border-radius: 50px;
    padding: 0 16px;
    cursor: pointer;
    font-family: var(--font-heading);
    font-size: 0.85rem;
    transition: all 0.3s;
}

.chat-send-btn:hover {
    background: rgba(212, 168, 83, 0.4);
}

.followup-toggle-btn {
    background: rgba(184, 169, 232, 0.15);
    border: 1px solid rgba(184, 169, 232, 0.3);
    color: var(--lavender);
    border-radius: 50px;
    padding: 6px 12px;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.3s;
    font-family: var(--font-body);
}

.followup-toggle-btn:hover {
    background: rgba(184, 169, 232, 0.3);
    color: #fff;
}

/* ========================================
   Responsive
   ======================================== */
@media(max-width:500px){
    .spread-card{width:90px;height:140px}
    .card-spread{gap:8px}
    .reveal-card-scene{width:180px;height:270px}
    .title{font-size:2rem}
    .magic-circle{width:240px;height:240px}
    .app-header { top: 10px; right: 10px; gap: 8px; }
    .usage-counter-inner { padding: 6px 12px; font-size: 0.75rem; }
    .auth-btn { padding: 6px 12px; font-size: 0.75rem; }
    .premium-modal { border-radius: 20px; }
    .modal-content { padding: 28px 20px 20px; }
    .modal-pricing { grid-template-columns: 1fr; }
    .limit-card { padding: 30px 20px; }
}

/* ========================================
   📄 ポリシーページ用 動画背景
   ======================================== */
.video-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
}

.video-background video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.35;
}

.video-background .overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(12, 10, 26, 0.6) 0%, rgba(12, 10, 26, 0.8) 100%);
    z-index: 1;
}

/* ========== カード詳細モーダル ========== */
.card-detail-modal {
    background: rgba(12, 10, 26, 0.95);
    border: 1px solid rgba(212, 168, 83, 0.4);
    border-radius: 24px;
    padding: 30px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    backdrop-filter: blur(20px);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8), 0 0 20px rgba(212, 168, 83, 0.2);
    animation: modalPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.card-detail-content {
    display: flex;
    gap: 30px;
    margin-top: 10px;
}

@media (max-width: 600px) {
    .card-detail-content {
        flex-direction: column;
        align-items: center;
    }
}

.card-detail-image-box {
    flex: 0 0 240px;
}

.card-detail-image-box img {
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.card-detail-info {
    flex: 1;
    text-align: left;
}

.detail-card-name {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    color: var(--gold-light);
    margin-bottom: 5px;
}

.detail-card-position {
    font-size: 0.9rem;
    color: var(--lavender);
    margin-bottom: 20px;
    opacity: 0.8;
}

.detail-card-meaning {
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 16px;
    border: 1px solid rgba(212, 168, 83, 0.2);
}

.detail-card-meaning h4 {
    margin-bottom: 10px;
    color: var(--gold-light);
    font-family: var(--font-heading);
}

.detail-card-meaning p {
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.9);
}

/* お気に入りボタン */
.result-actions {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.action-btn {
    background: rgba(212, 168, 83, 0.1);
    border: 1px solid rgba(212, 168, 83, 0.3);
    color: var(--gold-light);
    padding: 10px 24px;
    border-radius: 50px;
    font-family: var(--font-heading);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.action-btn:hover {
    background: rgba(212, 168, 83, 0.2);
    border-color: var(--gold-light);
    transform: translateY(-2px);
}

.action-btn.active {
    background: var(--gold-light);
    color: #000;
}

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

/* 拡大可能なカードへのヒント */
.revealed-card {
    cursor: zoom-in;
}

.revealed-card::after {
    content: "🔍 Tap to detail";
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7rem;
    color: var(--lavender);
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s;
}

.revealed-card:hover::after {
    opacity: 1;
}

/* ========== 今日の守護天使モーダル ========== */
.daily-message-modal {
    background: linear-gradient(135deg, rgba(12, 10, 26, 0.98), rgba(30, 20, 60, 0.95));
    border: 1px solid rgba(212, 168, 83, 0.5);
    border-radius: 30px;
    padding: 0;
    width: 90%;
    max-width: 500px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 0 60px rgba(212, 168, 83, 0.3), inset 0 0 30px rgba(212, 168, 83, 0.1);
    animation: modalPop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.daily-angel-image {
    width: 100%;
    height: 220px;
    overflow: hidden;
    border-bottom: 1px solid rgba(212, 168, 83, 0.3);
}

.daily-angel-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.8) sepia(0.2);
}

.daily-message-content {
    padding: 30px;
    text-align: center;
}

.daily-date {
    font-size: 0.85rem;
    color: var(--gold-light);
    opacity: 0.8;
    margin-bottom: 5px;
    letter-spacing: 0.1em;
}

.daily-title {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    color: var(--lavender);
    text-transform: uppercase;
    letter-spacing: 0.3em;
    margin-bottom: 10px;
}

.daily-angel-name {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    color: var(--gold-light);
    margin-bottom: 20px;
    text-shadow: 0 0 15px rgba(212, 168, 83, 0.5);
}

.daily-text-box {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 25px;
    border: 1px solid rgba(212, 168, 83, 0.1);
}

.daily-text-box p {
    font-size: 1.05rem;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.95);
}

.daily-close-btn {
    background: linear-gradient(to right, var(--gold), var(--gold-light));
    border: none;
    color: #000;
    padding: 12px 40px;
    border-radius: 50px;
    font-family: var(--font-heading);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(212, 168, 83, 0.4);
}

.daily-close-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(212, 168, 83, 0.6);
}

/* ========== 鑑定書（PDF/印刷）用スタイル ========== */
/* Print styles consolidated below */

.title-logo {
    max-width: 100%;
    width: 400px;
    height: auto;
    margin: 0 auto 10px auto;
    display: block;
    filter: drop-shadow(0 0 15px rgba(212, 168, 83, 0.4));
    animation: fadeInSlide 1s ease forwards, divine-glow 4s ease-in-out infinite;
}

@keyframes divine-glow {
    0%, 100% { filter: drop-shadow(0 0 15px rgba(212, 168, 83, 0.4)); }
    50% { filter: drop-shadow(0 0 25px rgba(212, 168, 83, 0.7)); }
}

@media (max-width: 768px) {
    .title-logo {
        width: 80%;
    }
}

.feature-icon-img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    filter: drop-shadow(0 0 8px rgba(212, 168, 83, 0.3));
    margin-right: 15px;
    flex-shrink: 0;
}

@media (max-width: 480px) {
    .feature-icon-img {
        width: 40px;
        height: 40px;
    }
}

/* ========================================
   🖨️ 印刷用レイアウト (PDF出力用)
   ======================================== */
@media print {
    /* 改ページ設定: 1枚に収めるための余白調整 */
    @page {
        size: A4;
        margin: 8mm;
    }

    /* 不要な要素の完全排除 */
    #bg-video, .aurora-bg, .floating-feathers, .background-effects, #particle-canvas,
    .app-header, .app-footer, .result-actions, .retry-btn, .share-section,
    .premium-teaser, #deck-container, #spread-container, .magic-circle,
    .divine-rays, .tap-hint, .loading-indicator, .modal-overlay,
    .limit-overlay, .sidebar, header, nav, #canvas-stars,
    .setting-btn, #spread-options, .share-bonus-hint, .usage-counter {
        display: none !important;
    }

    body {
        background: #fff !important;
        color: #000 !important;
        padding: 0 !important;
        margin: 0 !important;
        overflow: visible !important;
    }

    #app {
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
        background: transparent !important;
    }

    /* 鑑定書コンテナのコンパクト化 */
    #reveal-container {
        display: block !important;
        padding: 8mm !important;
        border: 8px double #d4a853 !important;
        background: #fdfcf7 !important;
        min-height: auto !important;
        box-sizing: border-box !important;
        margin: 0 !important;
        position: relative !important;
        width: 100% !important;
    }

    /* タイトルの装飾 */
    #reveal-container::before {
        content: "✦ Angelique Tarot 鑑定書 ✦";
        display: block;
        text-align: center;
        font-family: 'Cinzel', serif;
        font-size: 1.8rem;
        color: #b38b3d;
        margin-bottom: 6mm;
        border-bottom: 1px solid rgba(212, 168, 83, 0.3);
        padding-bottom: 4mm;
    }

    .spread-title {
        display: none !important;
    }

    /* カードコンテナ: 1枚に収めるためにコンパクトに配置 */
    .revealed-cards-container {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 4mm !important;
        margin-bottom: 6mm !important;
        perspective: none !important;
    }

    .celtic-cross-layout {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 3mm !important;
    }

    .revealed-card-wrapper {
        width: 65px !important; /* カードを小さくしてスペースを確保 */
        text-align: center !important;
        page-break-inside: avoid;
        break-inside: avoid;
    }

    .card.revealed-card {
        width: 100% !important;
        height: 105px !important; /* アスペクト比を維持しつつ縮小 */
        box-shadow: none !important;
        border: 1px solid #d4a853 !important;
        transform: none !important;
    }

    .card-position-label {
        font-size: 7pt !important;
        color: #b38b3d !important;
        margin-bottom: 1mm !important;
        font-weight: bold !important;
        background: transparent !important;
        border: none !important;
        padding: 0 !important;
    }

    .card-art {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
    }

    .card-overlay {
        display: none !important; /* 印刷時はカード画像のみでスッキリさせる */
    }

    /* 鑑定結果テキストの調整 */
    .reading-result {
        background: transparent !important;
        padding: 0 4mm !important;
        margin: 0 !important;
        border: none !important;
        box-shadow: none !important;
    }

    .result-text {
        font-size: 10pt !important;
        line-height: 1.5 !important;
        color: #222 !important;
        white-space: pre-wrap !important;
        text-align: left !important;
        opacity: 1 !important;
        transform: none !important;
    }

    /* フッターメッセージ */
    #reveal-container::after {
        content: "あなたの魂が光り輝きますように。";
        display: block;
        text-align: right;
        margin-top: 6mm;
        font-family: 'Noto Serif JP', serif;
        font-style: italic;
        color: #b38b3d;
        font-size: 9pt;
    }
}

/* ----------------------------------------------------
   天使選択ボタン用 ツールチップ (Tooltip)
   ---------------------------------------------------- */
.setting-btn[data-tooltip] {
    position: relative;
}

.setting-btn[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.95);
    color: #e2e8f0;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.8rem;
    z-index: 100;
    border: 1px solid rgba(212, 168, 83, 0.4);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
    pointer-events: none;
    opacity: 0;
    animation: fadeInTooltip 0.2s forwards;
    white-space: normal;
    width: 220px;
    text-align: left;
    line-height: 1.5;
    /* サイバーパンク風グロウ */
    box-shadow: 0 0 10px rgba(212, 168, 83, 0.2), inset 0 0 5px rgba(212, 168, 83, 0.1);
}

.setting-btn[data-tooltip]:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: rgba(212, 168, 83, 0.4) transparent transparent transparent;
    z-index: 100;
    pointer-events: none;
    opacity: 0;
    animation: fadeInTooltip 0.2s forwards;
}

@keyframes fadeInTooltip {
    to {
        opacity: 1;
    }
}
