/* 派大仙の神秘梗圖占卜機 - 樣式表 */

/* 基礎設定 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans TC', sans-serif;
    background: linear-gradient(180deg, #0a0e27 0%, #1a237e 50%, #0d47a1 100%);
    min-height: 100vh;
    color: #fff;
    overflow-x: hidden;
    position: relative;
}

/* 背景泡泡動畫 */
.bubbles {
    position: fixed;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
}

.bubble {
    position: absolute;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0.1) 100%);
    border-radius: 50%;
    opacity: 0.7;
    animation: float 15s infinite ease-in-out;
}

.bubble:nth-child(1) { width: 40px; height: 40px; left: 10%; animation-delay: 0s; }
.bubble:nth-child(2) { width: 60px; height: 60px; left: 20%; animation-delay: 2s; }
.bubble:nth-child(3) { width: 35px; height: 35px; left: 35%; animation-delay: 4s; }
.bubble:nth-child(4) { width: 80px; height: 80px; left: 50%; animation-delay: 0s; }
.bubble:nth-child(5) { width: 45px; height: 45px; left: 65%; animation-delay: 3s; }
.bubble:nth-child(6) { width: 55px; height: 55px; left: 75%; animation-delay: 2s; }
.bubble:nth-child(7) { width: 70px; height: 70px; left: 85%; animation-delay: 5s; }
.bubble:nth-child(8) { width: 50px; height: 50px; left: 95%; animation-delay: 1s; }

@keyframes float {
    0% { transform: translateY(100vh) scale(0); }
    10% { transform: translateY(90vh) scale(1); }
    90% { transform: translateY(-10vh) scale(1); }
    100% { transform: translateY(-100px) scale(0); }
}

/* 主容器 */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 10;
}

/* 標題區 */
.header {
    text-align: center;
    margin-bottom: 40px;
    animation: glow 2s ease-in-out infinite alternate;
}

.main-title {
    font-size: 2.5rem;
    font-weight: 900;
    background: linear-gradient(45deg, #ffd700, #ffed4b, #ffd700);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
    margin-bottom: 10px;
}

.star {
    display: inline-block;
    animation: rotate 3s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.subtitle {
    font-size: 1.1rem;
    color: #b3e5fc;
    opacity: 0.9;
}

/* 占卜區 */
.fortune-area {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 30px;
    padding: 40px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* 水晶球 */
.crystal-ball {
    width: 150px;
    height: 150px;
    margin: 0 auto 30px;
    position: relative;
}

.crystal-inner {
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.8), rgba(200,200,255,0.3));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 
        inset 0 0 50px rgba(255,255,255,0.5),
        0 0 50px rgba(100,100,255,0.5);
    animation: pulse 3s ease-in-out infinite;
}

.crystal-emoji {
    font-size: 4rem;
    animation: float-emoji 3s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes float-emoji {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* 輸入區 */
.section-title {
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: #ffd700;
}

.question-input {
    width: 100%;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    color: #fff;
    font-size: 1.1rem;
    resize: vertical;
    transition: all 0.3s;
}

.question-input:focus {
    outline: none;
    border-color: #ffd700;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.question-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

/* 占卜按鈕 */
.divine-btn {
    display: block;
    margin: 30px auto;
    padding: 15px 40px;
    background: linear-gradient(135deg, #ff6b6b, #ff8c42);
    border: none;
    border-radius: 50px;
    color: #fff;
    font-size: 1.3rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.divine-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(255, 107, 107, 0.5);
}

.divine-btn:active {
    transform: translateY(0);
}

.btn-sparkle {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    animation: sparkle 1s ease-in-out infinite;
}

@keyframes sparkle {
    0%, 100% { opacity: 1; transform: translateY(-50%) scale(1); }
    50% { opacity: 0.5; transform: translateY(-50%) scale(1.2); }
}

.hint {
    text-align: center;
    color: #b3e5fc;
    font-size: 0.9rem;
    opacity: 0.8;
}

/* 結果區 */
.result-section {
    animation: fadeIn 0.5s ease-in;
}

.meme-card {
    max-width: 400px;
    margin: 0 auto 30px;
    position: relative;
}

.meme-image {
    width: 100%;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    position: relative;
    z-index: 2;
}

.meme-glow {
    position: absolute;
    top: -20px;
    left: -20px;
    right: -20px;
    bottom: -20px;
    background: radial-gradient(circle, rgba(255,215,0,0.3) 0%, transparent 70%);
    border-radius: 30px;
    z-index: 1;
    animation: glow-pulse 2s ease-in-out infinite;
}

@keyframes glow-pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.fortune-text {
    background: rgba(0, 0, 0, 0.3);
    padding: 30px;
    border-radius: 20px;
    margin-bottom: 30px;
    line-height: 1.8;
    font-size: 1.1rem;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.fortune-text h3 {
    color: #ffd700;
    margin: 20px 0 10px;
    font-size: 1.3rem;
}

.fortune-text p {
    margin-bottom: 15px;
}

/* 卡片資訊樣式 */
.card-info {
    background: rgba(255, 215, 0, 0.1);
    padding: 15px;
    border-radius: 15px;
    margin-bottom: 20px;
    border: 1px dashed rgba(255, 215, 0, 0.5);
}

.card-description {
    margin: 0 0 10px 0;
    font-style: italic;
    color: #ffeb3b;
    text-align: center;
}

.card-tag {
    display: inline-block;
    padding: 5px 15px;
    margin: 5px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.card-tag.category {
    background: rgba(156, 39, 176, 0.3);
    border: 1px solid #9c27b0;
}

.card-tag.emotion {
    background: rgba(255, 87, 34, 0.3);
    border: 1px solid #ff5722;
}

/* 再問一卦按鈕 */
.redivine-btn {
    display: block;
    margin: 0 auto;
    padding: 12px 30px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 30px;
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s;
}

.redivine-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

/* 載入動畫 */
.loading {
    text-align: center;
    padding: 50px;
}

.loading-spinner {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.wave {
    width: 20px;
    height: 100px;
    background: linear-gradient(to bottom, #ffd700, #ff8c42);
    margin: 0 5px;
    border-radius: 10px;
    animation: wave-animation 1s ease-in-out infinite;
}

.wave:nth-child(2) { animation-delay: 0.1s; }
.wave:nth-child(3) { animation-delay: 0.2s; }

@keyframes wave-animation {
    0%, 100% { transform: scaleY(0.5); }
    50% { transform: scaleY(1); }
}

.loading-text {
    font-size: 1.2rem;
    color: #ffd700;
}

/* 底部裝飾 */
.footer {
    margin-top: 50px;
    text-align: center;
    position: relative;
}

.seaweed {
    position: absolute;
    bottom: -20px;
    width: 60px;
    height: 150px;
    background: linear-gradient(to top, #2e7d32, #4caf50);
    border-radius: 0 100% 0 100%;
    opacity: 0.3;
    animation: sway 4s ease-in-out infinite;
}

.seaweed.left {
    left: 10%;
    animation-delay: 0s;
}

.seaweed.right {
    right: 10%;
    animation-delay: 2s;
    transform: scaleX(-1);
}

@keyframes sway {
    0%, 100% { transform: rotate(-5deg); }
    50% { transform: rotate(5deg); }
}

.footer-text {
    color: #b3e5fc;
    font-size: 0.9rem;
    opacity: 0.7;
}

/* 工具類 */
.hidden {
    display: none !important;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes glow {
    from { filter: brightness(1); }
    to { filter: brightness(1.2); }
}

/* 響應式設計 */
@media (max-width: 768px) {
    .main-title {
        font-size: 2rem;
    }
    
    .fortune-area {
        padding: 20px;
    }
    
    .crystal-ball {
        width: 120px;
        height: 120px;
    }
    
    .crystal-emoji {
        font-size: 3rem;
    }
}