/* 設置背景樣式 */
body {
    margin: 0;
    background: #000; /* 黑色背景 */
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column; /* 垂直排列 */
    overflow: hidden;
}

/* 水晶球外觀 */
.crystal-ball {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle at 70% 30%, rgba(0, 200, 255, 0.5), rgba(0, 200, 255, 0.1), rgba(0, 0, 0, 0.8)); /* 半透明顏色 */
    border-radius: 50%;
    position: relative;
    box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.5),
                0 0 40px rgba(0, 200, 255, 0.8),
                0 0 80px rgba(0, 200, 255, 0.5);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    opacity: 0.9; /* 半透明效果 */
    animation: rotate 10s linear infinite; /* 添加旋轉動畫 */
}

/* 旋轉動畫 */
@keyframes rotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* 速度從慢到快的動畫 */
@keyframes slowToFastRotate {
    0% {
        animation-timing-function: ease-in;
        transform: rotate(0deg);
    }
    50% {
        animation-timing-function: linear;
        transform: rotate(180deg);
    }
    100% {
        animation-timing-function: ease-out;
        transform: rotate(360deg);
    }
}

/* 使用慢到快的動畫 */
.crystal-ballFather.slow-to-fast-rotate {
    animation: slowToFastRotate 10s infinite;
}

/* 快速旋轉動畫 */
@keyframes fastRotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* 定義 fast-rotate 類 */
.fast-rotate {
    animation: fastRotate 2s linear infinite;
}

/* 水晶球激活狀態 */
.crystal-ball.active {
    animation: bounce 1.5s ease-in-out infinite, glow 10s infinite alternate;
}

/* 彈跳動畫 */
@keyframes bounce {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.3);
    }
}

/* 發光特效 */
@keyframes glow {
    from {
        box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.5),
                    0 0 80px rgba(0, 200, 255, 0.8),
                    0 0 150px rgba(0, 200, 255, 0.7);
    }
    to {
        box-shadow: inset 0 0 30px rgba(255, 255, 255, 0.8),
                    0 0 120px rgba(0, 200, 255, 1),
                    0 0 200px rgba(0, 200, 255, 0.9);
    }
}

/* 水晶球內的文字 */
.text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 1.5rem;
    font-family: 'Arial', sans-serif;
    text-align: center;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
    opacity: 0; /* 初始隱藏 */
    animation: none;
    pointer-events: none;
}

/* 文字淡入放大效果 */
@keyframes fadeInZoom {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.2);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* 輸入框容器 */
.input-container {
    margin-top: 80px;
    width: 80%;
    max-width: 400px;
    display: flex;
    justify-content: center; /* 水平置中 */
}

/* 輸入框樣式 */
.input-container input {
    width: 100%;
    padding: 10px;
    font-size: 1rem;
    border: 2px solid #00c8ff;
    border-radius: 5px;
    background-color: rgba(0, 0, 0, 0.8);
    color: #fff;
    box-shadow: 0 0 10px rgba(0, 200, 255, 0.5);
    outline: none;
    transition: box-shadow 0.3s ease;
}

.input-container input::placeholder {
    color: #aaa;
}

.input-container input:focus {
    box-shadow: 0 0 20px rgba(0, 200, 255, 0.8);
}

/* 點擊時縮小效果和變色 */
.click:active {
    transform: scale(0.9); /* 縮小至 90% */
    transition: transform 0.2s, color 0.2s; /* 添加過渡效果 */
    color: #808080; /* 灰色 */
}

/* 定義點擊動畫 */
@keyframes coolEffect {
    0% {
        transform: scale(1);
        color: #4a3636;
    }
    50% {
        transform: scale(1.2);
        color: #ff6347; /* ��中變成橙色 */
    }
    100% {
        transform: scale(1);
        color: #808080; /* 最後變成灰色 */
    }
}

/* 點擊時觸發動畫 */
.click:active {
    animation: coolEffect 0.5s ease-in-out;
    transition: transform 0.2s, color 0.2s; /* 添加過渡效果 */
}

/* Reset button styles */
#resetButton {
    margin-top: 20px;
    padding: 10px 20px;
    font-size: 1rem;
    border: none;
    border-radius: 5px;
    background-color: #00c8ff;
    color: #fff;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#resetButton:hover {
    background-color: #009acd;
}

/* 按鈕容器樣式 */
.button-container {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 10px;
}

/* Anchor styles */
.button-container a {
    padding: 10px 20px;
    font-size: 1rem;
    border: none;
    border-radius: 5px;
    background-color: #6600ff;
    color: #fff;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: relative;
}

/* Hover effect */
.button-container a:hover {
    background-color: #5501a5;
    transform: translateY(-5px);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.2);
}

/* Active effect */
.button-container a:active {
    transform: translateY(0);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Add a glowing effect */
.button-container a::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    background: rgba(42, 4, 140, 0.5);
    border-radius: 5px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.button-container a:hover::before {
    opacity: 1;
}

/* 無限放大且加速動畫 */
@keyframes infiniteScaleUp {
    0% {
        transform: scale(1);
    }
    80% {
        transform: scale(8);
    }
    100% {
        transform: scale(12);
    }
}

/* 定義 infinite-scale-up 類 */
.infinite-scale-up {
    animation: infiniteScaleUp 3s ease-in infinite; /* 持續3秒，每次重複加速 */
    transform-origin: center; /* 保證動畫從中心放大 */
}


/* 爆破動畫 */
@keyframes explosion {
    0% {
        opacity: 1;
        transform: scale(20);
    }
    100% {
        opacity: 0;
        transform: scale(30);
    }
}

/* 定義 explosion 類 */
.explosion {
    animation: explosion 1s ease-out forwards;
}

