/* Mystic Tarot - 主样式文件 */

/* 全局重置 */
*::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; overflow-x: hidden; scroll-behavior: smooth; }
body {
    font-family: 'Crimson Text', serif;
    background: linear-gradient(135deg, #0a0a0f 0%, #1a1a2e 50%, #12121a 100%);
    min-height: 100vh;
    color: #e8e6e3;
    position: relative;
}

/* 星空背景 */
.stars-bg {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none; z-index: 0; overflow: hidden;
}
.star {
    position: absolute; width: 4px; height: 4px; background: white;
    border-radius: 50%; animation: twinkle 3s infinite ease-in-out;
}
@keyframes twinkle {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
}

/* 神秘光晕 */
.mystic-glow {
    position: fixed; width: 600px; height: 600px; border-radius: 50%;
    background: radial-gradient(circle, rgba(107, 76, 154, 0.15) 0%, transparent 70%);
    pointer-events: none; z-index: 1; animation: float 20s infinite ease-in-out;
}
.mystic-glow:nth-child(2) {
    background: radial-gradient(circle, rgba(212, 175, 55, 0.1) 0%, transparent 70%);
    animation-delay: -10s; width: 400px; height: 400px;
}
@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(50px, -30px) scale(1.05); }
    50% { transform: translate(-30px, 50px) scale(0.95); }
    75% { transform: translate(-50px, -20px) scale(1.02); }
}

.main-container {
    position: relative; z-index: 10; min-height: 100vh;
    display: flex; flex-direction: column; align-items: center;
    padding: 2rem 1rem;
}

/* 标题 */
.title-section { text-align: center; margin-bottom: 2rem; animation: fadeInDown 1s ease-out; }
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}
.main-title {
    font-family: 'Cinzel', serif;
    font-size: clamp(2.5rem, 8vw, 5rem); font-weight: 600;
    background: linear-gradient(135deg, #d4af37 0%, #f0d878 50%, #d4af37 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 60px rgba(212, 175, 55, 0.3);
    letter-spacing: 0.1em; margin-bottom: 0.5rem;
    text-align: center; width: 100%;
}
.subtitle {
    font-family: 'Crimson Text', serif;
    font-size: clamp(1rem, 3vw, 1.25rem);
    color: #9b7fcf; font-style: italic;
    letter-spacing: 0.15em;
    text-align: center; width: 100%;
}

.page-section { display: none; width: 100%; }
.page-section.active { display: flex; flex-direction: column; align-items: center; width: 100%; }

/* 占卜法选择卡片 */
.spread-selection { width: 100%; max-width: 900px; display: flex; flex-direction: column; gap: 1.5rem; }
.spread-card {
    background: linear-gradient(145deg, rgba(26, 26, 46, 0.9) 0%, rgba(37, 37, 66, 0.8) 100%);
    border: 1px solid rgba(212, 175, 55, 0.2); border-radius: 20px;
    padding: 1.5rem 2rem; display: flex; align-items: center; gap: 2rem;
    cursor: pointer; transition: all 0.4s ease; position: relative; overflow: hidden;
}
.spread-card::before {
    content: ''; position: absolute; top: 0; left: 0; width: 4px; height: 100%;
    background: linear-gradient(180deg, #d4af37 0%, #6b4c9a 100%);
    opacity: 0; transition: opacity 0.4s ease;
}
.spread-card:hover { border-color: rgba(212, 175, 55, 0.5); transform: translateX(10px); box-shadow: 0 10px 40px rgba(212, 175, 55, 0.1); }
.spread-card:hover::before { opacity: 1; }
.spread-icon {
    width: 80px; height: 80px; border-radius: 16px;
    background: linear-gradient(145deg, rgba(107, 76, 154, 0.3) 0%, rgba(212, 175, 55, 0.2) 100%);
    border: 2px solid rgba(212, 175, 55, 0.3);
    display: flex; align-items: center; justify-content: center;
    font-size: 2.5rem; flex-shrink: 0;
}
.spread-info { flex: 1; }
.spread-title { font-family: 'Cinzel', serif; font-size: 1.4rem; font-weight: 600; color: #f0d878; margin-bottom: 0.5rem; letter-spacing: 0.05em; }
.spread-desc { font-size: 0.95rem; color: #b8b5b0; line-height: 1.6; margin-bottom: 0.75rem; }
.spread-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.spread-tag { background: rgba(107, 76, 154, 0.3); border: 1px solid rgba(155, 127, 207, 0.3); border-radius: 20px; padding: 0.25rem 0.75rem; font-size: 0.8rem; color: #9b7fcf; }

/* 牌组 */
.deck-container { position: relative; width: 200px; height: 320px; perspective: 1000px; margin-bottom: 2rem; transition: opacity 0.5s ease, transform 0.5s ease; }
.deck-container.hidden { opacity: 0; transform: scale(0.9); pointer-events: none; }
.deck-card { position: absolute; width: 100%; height: 100%; border-radius: 16px; background: linear-gradient(145deg, #1a1a2e 0%, #252542 100%); border: 2px solid #d4af37; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5); transform-style: preserve-3d; transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1); cursor: pointer; }
.deck-card::before { content: ''; position: absolute; inset: 8px; border: 1px solid rgba(212, 175, 55, 0.3); border-radius: 12px; }
.deck-card::after { content: '✦'; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 3rem; color: #d4af37; opacity: 0.6; }
.deck-card:nth-child(1) { transform: translateY(0) rotate(0deg); z-index: 5; }
.deck-card:nth-child(2) { transform: translateY(-4px) rotate(-1deg); z-index: 4; }
.deck-card:nth-child(3) { transform: translateY(-8px) rotate(1deg); z-index: 3; }
.deck-card:nth-child(4) { transform: translateY(-12px) rotate(-0.5deg); z-index: 2; }
.deck-card:nth-child(5) { transform: translateY(-16px) rotate(0.5deg); z-index: 1; }
.deck-container:hover .deck-card:nth-child(1) { transform: translateY(0) rotate(-3deg) translateX(-5px); }
.deck-container:hover .deck-card:nth-child(2) { transform: translateY(-4px) rotate(-2deg) translateX(-2px); }
.deck-container:hover .deck-card:nth-child(3) { transform: translateY(-8px) rotate(0deg); }
.deck-container:hover .deck-card:nth-child(4) { transform: translateY(-12px) rotate(2deg) translateX(2px); }
.deck-container:hover .deck-card:nth-child(5) { transform: translateY(-16px) rotate(3deg) translateX(5px); }

/* 按钮样式 */
.draw-button {
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    padding: 1rem 3rem;
    background: linear-gradient(135deg, #d4af37 0%, #b8942e 50%, #d4af37 100%);
    background-size: 200% 100%;
    border: none;
    border-radius: 50px;
    color: #0a0a0f;
    cursor: pointer;
    box-shadow: 0 10px 40px rgba(212, 175, 55, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}
.draw-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s ease;
}
.draw-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 50px rgba(212, 175, 55, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    background-position: 100% 0;
}
.draw-button:hover::before { left: 100%; }
.draw-button:active { transform: translateY(-1px); }
.draw-button:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* 抽牌结果 */
.result-section {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    margin-top: 3rem;
    animation: fadeInUp 0.8s ease-out;
    width: 100%;
}
.result-section.active { display: flex; }
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 塔罗牌展示 */
.card-display { perspective: 1000px; width: 280px; height: 450px; }
.tarot-card { width: 100%; height: 100%; position: relative; transform-style: preserve-3d; transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1); cursor: pointer; }
.tarot-card.flipped { transform: rotateY(180deg); }
.card-face { position: absolute; width: 100%; height: 100%; backface-visibility: hidden; border-radius: 20px; overflow: hidden; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); }
.card-back { background: linear-gradient(145deg, #1a1a2e 0%, #252542 100%); border: 3px solid #d4af37; display: flex; align-items: center; justify-content: center; transform: rotateY(0deg); }
.card-back::before { content: ''; position: absolute; inset: 12px; border: 1px solid rgba(212, 175, 55, 0.4); border-radius: 12px; }
.card-back::after { content: '✦'; font-size: 5rem; color: #d4af37; opacity: 0.6; }
.card-front { background: linear-gradient(180deg, #2a2a4a 0%, #1a1a2e 50%, #0f0f1a 100%); border: 3px solid #d4af37; transform: rotateY(180deg); display: flex; flex-direction: column; align-items: center; padding: 1.5rem; }
.card-front::before { content: ''; position: absolute; inset: 10px; border: 1px solid rgba(212, 175, 55, 0.3); border-radius: 14px; pointer-events: none; }
.card-number { font-family: 'Cinzel', serif; font-size: 0.85rem; color: #d4af37; opacity: 0.7; letter-spacing: 0.2em; margin-bottom: 0.5rem; }
.card-image { width: 140px; height: 140px; margin: 0.5rem 0; display: flex; align-items: center; justify-content: center; font-size: 4.5rem; filter: drop-shadow(0 0 20px rgba(212, 175, 55, 0.3)); }
.card-name { font-family: 'Cinzel', serif; font-size: 1.1rem; color: #f0d878; text-align: center; margin: 0.5rem 0; letter-spacing: 0.08em; font-weight: 600; }
.card-keywords { font-size: 0.8rem; color: #9b7fcf; text-align: center; font-style: italic; letter-spacing: 0.05em; }

/* 解读区域 */
.interpretation { background: linear-gradient(145deg, rgba(26, 26, 46, 0.9) 0%, rgba(37, 37, 66, 0.8) 100%); border: 1px solid rgba(212, 175, 55, 0.3); border-radius: 20px; padding: 2rem; max-width: 700px; width: 100%; margin: 0 auto; backdrop-filter: blur(10px); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3); text-align: center; }
.interpretation h3 { font-family: 'Cinzel', serif; font-size: 1.3rem; color: #d4af37; margin-bottom: 1rem; text-align: center; letter-spacing: 0.15em; }
.interpretation p { font-size: 1.05rem; line-height: 1.9; color: #e8e6e3; text-align: center; white-space: pre-line; display: block; }

/* 操作按钮组 */
.action-buttons { display: flex; gap: 1rem; margin-top: 1rem; flex-wrap: wrap; justify-content: center; }
.secondary-button { font-family: 'Cinzel', serif; font-size: 0.95rem; font-weight: 500; letter-spacing: 0.15em; padding: 0.9rem 2rem; background: transparent; border: 2px solid #d4af37; border-radius: 50px; color: #d4af37; cursor: pointer; transition: all 0.4s ease; }
.secondary-button:hover { background: rgba(212, 175, 55, 0.1); transform: translateY(-2px); box-shadow: 0 10px 30px rgba(212, 175, 55, 0.2); }

/* 提示文字 */
.hint-text { font-size: 0.9rem; color: #9b7fcf; text-align: center; margin-top: 1.5rem; font-style: italic; animation: pulse 3s infinite ease-in-out; }
@keyframes pulse { 0%, 100% { opacity: 0.5; } 50% { opacity: 0.9; } }

/* 三张牌布局 */
.three-cards-display { display: flex; justify-content: center; gap: 2rem; flex-wrap: wrap; margin: 2rem 0; }
.three-card-slot { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; }
.slot-label { font-family: 'Cinzel', serif; font-size: 1rem; color: #d4af37; letter-spacing: 0.1em; }
.slot-position { font-size: 0.85rem; color: #9b7fcf; font-style: italic; }

/* 五张牌十字布局 */
.five-cards-display { display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, auto); gap: 1.5rem; margin: 2rem 0; max-width: 700px; justify-items: center; }
.five-card-slot { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; }
.five-card-slot:nth-child(1) { grid-column: 2; grid-row: 1; }
.five-card-slot:nth-child(2) { grid-column: 1; grid-row: 2; }
.five-card-slot:nth-child(3) { grid-column: 2; grid-row: 2; }
.five-card-slot:nth-child(4) { grid-column: 3; grid-row: 2; }
.five-card-slot:nth-child(5) { grid-column: 2; grid-row: 3; }

/* 时间流牌阵布局 */
.timeflow-display { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; margin: 2rem 0; max-width: 800px; justify-items: center; }
.timeflow-card-slot { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; }

/* 维纳斯牌阵布局 (8张) */
.venus-display { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; margin: 2rem 0; max-width: 900px; justify-items: center; }
.venus-card-slot { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; }
@media (max-width: 900px) {
    .venus-display { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 500px) {
    .venus-display { grid-template-columns: 1fr; }
}

/* 终身伴侣牌阵布局 */
.lifetime-display { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1.5rem; margin: 2rem 0; max-width: 1000px; justify-items: center; }
.lifetime-card-slot { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; }
@media (max-width: 1000px) {
    .lifetime-display { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 600px) {
    .lifetime-display { grid-template-columns: repeat(2, 1fr); }
}

/* 分手判断牌阵布局 */
.breakup-display { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1.5rem; margin: 2rem 0; max-width: 1000px; justify-items: center; }
.breakup-card-slot { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; }
@media (max-width: 1000px) {
    .breakup-display { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 600px) {
    .breakup-display { grid-template-columns: repeat(2, 1fr); }
}

/* 小卡片 */
.card-display-small { perspective: 1000px; width: 180px; height: 290px; }
.tarot-card-small { width: 100%; height: 100%; position: relative; transform-style: preserve-3d; transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1); cursor: pointer; }
.tarot-card-small.flipped { transform: rotateY(180deg); }
.card-face-small { position: absolute; width: 100%; height: 100%; backface-visibility: hidden; border-radius: 16px; overflow: hidden; box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4); }
.card-back-small { background: linear-gradient(145deg, #1a1a2e 0%, #252542 100%); border: 2px solid #d4af37; display: flex; align-items: center; justify-content: center; transform: rotateY(0deg); }
.card-back-small::after { content: '✦'; font-size: 3rem; color: #d4af37; opacity: 0.6; }
.card-front-small { background: linear-gradient(180deg, #2a2a4a 0%, #1a1a2e 50%, #0f0f1a 100%); border: 2px solid #d4af37; transform: rotateY(180deg); display: flex; flex-direction: column; align-items: center; padding: 1rem; }
.card-number-small { font-family: 'Cinzel', serif; font-size: 0.7rem; color: #d4af37; opacity: 0.7; }
.card-image-small { width: 80px; height: 80px; margin: 0.25rem 0; display: flex; align-items: center; justify-content: center; font-size: 2.5rem; }
.card-name-small { font-family: 'Cinzel', serif; font-size: 0.9rem; color: #f0d878; text-align: center; margin: 0; }
.card-keywords-small { font-size: 0.65rem; color: #9b7fcf; text-align: center; font-style: italic; }

/* 牌阵说明 */
.spread-intro { background: linear-gradient(145deg, rgba(26, 26, 46, 0.9) 0%, rgba(37, 37, 66, 0.8) 100%); border: 1px solid rgba(212, 175, 55, 0.2); border-radius: 16px; padding: 1.5rem; margin-bottom: 2rem; max-width: 700px; }
.spread-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.spread-header h2 { font-family: 'Cinzel', serif; font-size: 1.5rem; color: #f0d878; margin: 0; }
.spread-tags-header { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.spread-tag-header { background: rgba(212, 175, 55, 0.2); border: 1px solid rgba(212, 175, 55, 0.4); border-radius: 20px; padding: 0.2rem 0.7rem; font-size: 0.75rem; color: #d4af37; }
.spread-description { font-size: 0.95rem; color: #b8b5b0; line-height: 1.6; margin: 0; }

/* 返回按钮 */
.back-button { position: absolute; top: 1.5rem; left: 1.5rem; font-family: 'Cinzel', serif; font-size: 0.9rem; padding: 0.7rem 1.5rem; background: transparent; border: 1px solid rgba(212, 175, 55, 0.5); border-radius: 30px; color: #d4af37; cursor: pointer; transition: all 0.3s ease; z-index: 100; }
.back-button:hover { background: rgba(212, 175, 55, 0.1); border-color: #d4af37; }

/* 响应式 */
@media (max-width: 768px) {
    .spread-card { flex-direction: column; text-align: center; padding: 1.5rem; }
    .three-cards-display { flex-direction: column; align-items: center; }
    .five-cards-display { grid-template-columns: 1fr; grid-template-rows: auto; gap: 1rem; }
    .five-card-slot:nth-child(1), .five-card-slot:nth-child(2), .five-card-slot:nth-child(3), .five-card-slot:nth-child(4), .five-card-slot:nth-child(5) { grid-column: 1; grid-row: auto; }
    .card-display, .card-display-small { width: 160px; height: 260px; }
    .back-button { top: 1rem; left: 1rem; }
}
