/*
body { // This global body style is now handled by body.card-background in transitions.css
    background: linear-gradient(135deg, #ffeaa7, #fab1a0, #fd79a8, #a29bfe);
    background-size: 400% 400%;
    animation: gradientShift 8s ease infinite;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
*/

#card-scene .card { /* 限定作用域到 #card-scene */
    width: 400px; /* 恢復原本寬度 */
    height: 650px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 25px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    position: relative;
    overflow: hidden;
    animation: cardFloat 3s ease-in-out infinite;
    font-family: 'Noto Sans TC', sans-serif; /* 確保賀卡字體 */
}

@keyframes cardFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-5px); }
}

#card-scene .card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: shine 4s ease-in-out infinite;
}

@keyframes shine {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    50% { transform: translateX(100%) translateY(100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); } /* 保持在結束位置，避免閃爍 */
}

#card-scene .header {
    text-align: center;
    padding: 40px 30px 20px;
    position: relative;
    z-index: 2;
}

#card-scene .name {
    font-size: 32px;
    font-weight: 700;
    color: #2d3436;
    margin-bottom: 5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#card-scene .birthday-text {
    font-size: 24px;
    color: #e17055;
    font-weight: 500;
    margin-bottom: 20px;
}

#card-scene .emoji {
    font-size: 36px;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

#card-scene .content {
    padding: 0 35px;
    position: relative;
    z-index: 2;
}

#card-scene .message {
    font-size: 16px;
    line-height: 1.8;
    color: #2d3436;
    text-align: left;
    margin-bottom: 30px;
    font-weight: 400;
}

#card-scene .signature {
    text-align: right;
    font-size: 16px;
    color: #636e72;
    font-weight: 300;
    font-style: italic;
    margin-top: 20px;
    padding-right: 10px;
}

#card-scene .decorations {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

#card-scene .star {
    position: absolute;
    color: #fdcb6e;
    animation: twinkle 2s ease-in-out infinite;
}

#card-scene .star:nth-child(1) { top: 15%; left: 10%; font-size: 20px; animation-delay: 0s; }
#card-scene .star:nth-child(2) { top: 25%; right: 15%; font-size: 16px; animation-delay: 0.5s; }
#card-scene .star:nth-child(3) { top: 45%; left: 8%; font-size: 18px; animation-delay: 1s; }
#card-scene .star:nth-child(4) { bottom: 25%; right: 10%; font-size: 22px; animation-delay: 1.5s; }
#card-scene .star:nth-child(5) { bottom: 15%; left: 12%; font-size: 14px; animation-delay: 2s; }

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

#card-scene .heart {
    position: absolute;
    color: #fd79a8;
    font-size: 12px;
    animation: heartbeat 3s ease-in-out infinite;
}

#card-scene .heart:nth-child(6) { top: 35%; right: 8%; animation-delay: 0.5s; } /* 調整選擇器以匹配HTML結構 */
#card-scene .heart:nth-child(7) { top: 55%; left: 5%; animation-delay: 1.5s; }
#card-scene .heart:nth-child(8) { bottom: 35%; right: 5%; animation-delay: 2.5s; }


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

#card-scene .sparkles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

#card-scene .sparkle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #74b9ff;
    border-radius: 50%;
    animation: sparkle 3s ease-in-out infinite;
}

#card-scene .sparkle:nth-child(1) { top: 20%; left: 20%; animation-delay: 0s; }
#card-scene .sparkle:nth-child(2) { top: 30%; right: 25%; animation-delay: 1s; }
#card-scene .sparkle:nth-child(3) { bottom: 30%; left: 25%; animation-delay: 2s; }
#card-scene .sparkle:nth-child(4) { bottom: 20%; right: 20%; animation-delay: 0.5s; }


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

/* 圖片樣式 - 拍立得效果，可拖拽，內外框設計 */
#card-scene .nero-image {
    position: absolute;
    left: -15px; /* 初始位置 */
    bottom: -20px; /* 初始位置 */
    width: 120px; /* 縮小拍立得寬度 */
    height: 150px; /* 縮小拍立得高度（包含下方白邊） */
    z-index: 25; /* 最高 z-index，在所有元素之上 */
    pointer-events: auto; /* 允許點擊事件進行拖拽 */
    cursor: move; /* 顯示移動游標 */
    user-select: none; /* 防止文字選取 */
    
    /* 拍立得外框效果 - 白色 */
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3), 
                0 4px 8px rgba(0, 0, 0, 0.2);
    padding: 12px; /* 外框邊距 */
    
    transform: rotate(-8deg); /* 稍微傾斜，增加真實感 */
    animation: polaroidFloat 4s ease-in-out infinite;
    transition: transform 0.1s ease-out; /* 平滑的移動過渡 */
}

/* 內框容器 - 夢幻紫色帶星光 */
#card-scene .nero-image::before {
    content: '';
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    bottom: 32px; /* 為底部白邊留出空間 */
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    border-radius: 4px;
    padding: 6px; /* 內框邊距 */
    z-index: 1;
    
    /* 星光效果 */
    background-image: 
        radial-gradient(2px 2px at 20px 30px, #fff, transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(255,255,255,0.8), transparent),
        radial-gradient(1px 1px at 60px 20px, #fff, transparent),
        radial-gradient(1px 1px at 80px 50px, rgba(255,255,255,0.6), transparent),
        radial-gradient(2px 2px at 15px 80px, #fff, transparent),
        radial-gradient(1px 1px at 70px 90px, rgba(255,255,255,0.8), transparent),
        linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    
    animation: sparkleShimmer 3s ease-in-out infinite;
}

@keyframes sparkleShimmer {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

/* 照片容器 */
#card-scene .nero-image .photo-container {
    position: absolute;
    top: 18px; /* 調整往上移動 */
    left: 18px; /* 外框 + 內框邊距 */
    width: calc(100% - 36px); /* 減去外框和內框的邊距 */
    height: calc(100% - 56px); /* 減去外框、內框和底部白邊的邊距 */
    border-radius: 2px;
    overflow: hidden;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 拍立得底部文字 */
#card-scene .nero-image .polaroid-text {
    position: absolute;
    bottom: 8px;
    left: 0;
    width: 100%;
    text-align: center;
    font-family: 'Klee One', cursive;
    font-size: 16px;
    color: #2d3436;
    z-index: 3;
    transform: rotate(2deg); /* 稍微傾斜文字增加手寫感 */
    letter-spacing: 2px;
    text-shadow: 0 0.5px 0.5px rgba(0, 0, 0, 0.1);
}

/* 照片本身 */
#card-scene .nero-image img {
    width: 100%;
    height: 95%; /* 稍微縮小高度以避免裁切 */
    object-fit: contain; /* 改為 contain 以保持圖片比例 */
    border-radius: 2px;
    position: relative;
    z-index: 2;
}

/* 閃卡光澤效果 */
#card-scene .nero-image .holographic-shine {
    position: absolute;
    top: -10%;
    left: -10%;
    width: 120%;
    height: 120%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.1) 40%,
        rgba(255, 255, 255, 0.3) 50%,
        rgba(255, 255, 255, 0.1) 60%,
        transparent 70%
    );
    transform: translateX(-100%) skewX(-15deg);
    animation: holographicShine 5s ease-in-out infinite;
    z-index: 3;
    pointer-events: none;
    border-radius: 2px;
}

@keyframes holographicShine {
    0% { 
        transform: translateX(-100%) skewX(-15deg);
        opacity: 0;
    }
    15% {
        opacity: 1;
    }
    85% {
        opacity: 1;
    }
    100% { 
        transform: translateX(200%) skewX(-15deg);
        opacity: 0;
    }
}

/* 拖拽時加強閃卡效果 */
#card-scene .nero-image.dragging .holographic-shine {
    animation: holographicShineIntense 1.5s ease-in-out infinite;
}

@keyframes holographicShineIntense {
    0% { 
        transform: translateX(-100%) skewX(-15deg);
        opacity: 0;
    }
    20% {
        opacity: 1;
    }
    80% {
        opacity: 1;
    }
    100% { 
        transform: translateX(200%) skewX(-15deg);
        opacity: 0;
    }
}

/* 拖拽時的樣式 */
#card-scene .nero-image.dragging {
    animation: none; /* 拖拽時停止浮動動畫 */
    transform: rotate(-8deg) scale(1.05); /* 拖拽時稍微放大 */
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4), 
                0 8px 15px rgba(0, 0, 0, 0.3); /* 拖拽時增強陰影 */
    z-index: 30; /* 拖拽時提升層級 */
}

/* 拖拽時內框效果也要增強 */
#card-scene .nero-image.dragging::before {
    animation: sparkleShimmerIntense 1s ease-in-out infinite;
}

@keyframes sparkleShimmerIntense {
    0%, 100% { opacity: 0.9; }
    50% { opacity: 1; }
}

@keyframes polaroidFloat {
    0%, 100% { 
        transform: rotate(-8deg) translateY(0px); 
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3), 
                    0 5px 10px rgba(0, 0, 0, 0.2);
    }
    50% { 
        transform: rotate(-7deg) translateY(-3px); 
        box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4), 
                    0 8px 15px rgba(0, 0, 0, 0.3);
    }
}

/* 在拍立得下方添加一個小陰影，增加貼在表面的感覺 */
#card-scene .nero-image::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 5px;
    right: 5px;
    height: 15px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    filter: blur(8px);
    z-index: -1;
}

/* 恢復原本的樣式 */
#card-scene .header {
    text-align: center;
    padding: 40px 30px 20px; /* 恢復原本 padding */
    position: relative;
    z-index: 2;
}

#card-scene .content {
    padding: 0 35px; /* 恢復原本 padding */
    position: relative;
    z-index: 2;
}

#card-scene .message {
    font-size: 16px; /* 恢復原本字體大小 */
    line-height: 1.8;
    color: #2d3436;
    text-align: left;
    margin-bottom: 30px; /* 恢復原本間距 */
    font-weight: 400;
}
