* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

body {
    background-color: #f0f0f0;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    height: 100vh;
}

/* CSS */

header {
    background-image: url('背景.jpg');
    background-size: cover;
    background-position: center;
    padding: 60px 0;
    color: #333;
    height: 150px;
    width: 100%;
    position: fixed; /* 固定在視窗頂部 */
    top: 0;
    left: 0;
    z-index: 1000; /* 確保置於其他元素之上 */
}

nav {
    background-color: #4b6769;
    padding: 10px;
    width: 100%;
    position: fixed; /* 固定在視窗頂部 */
    top: 150px; /* 確保 nav 在 header 之下 */
    z-index: 999; /* 保持在 header 下層，但仍高於其他內容 */
}

main {
    margin-top: 70px; /* 預留空間，避免內容被 header 和 nav 覆蓋 */
    background-color: #d1d1d1;
    padding: 20px;
    border-radius: 20%;
}


header h1 {
    font-size: 50px;
    color: #1a0a40;
    font-weight: 800;
}

nav ul {
    display: flex;
    justify-content: center;
    list-style: none;
}

nav ul li {
    margin: 0 15px;
}

nav ul li a {
    color: white;
    text-decoration: none;
    font-weight: bold;
}

nav ul li a.active {
    color: rgb(255, 237, 147);
}

.settings {
    margin: 20px;
    font-size: 20px;
}

.settings input {
    height: 30px;
    font-size: 18px;
    margin-left: 10px;
    width: 50px;
    text-align: center;
}

.dice-group {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 20px;
}

@keyframes rollDiceAnimation {
    0% { transform: rotate(0deg); }
    50% { transform: rotate(180deg); }
    100% { transform: rotate(360deg); }
}

.dice {
    width: 100px;
    height: 100px;
    background-color: #f0f8ff;
    border: 2px solid #4b6769;
    border-radius: 10px;
    position: relative;
    animation: rollDiceAnimation 0.6s ease-out;
}

.dot {
    width: 20px;
    height: 20px;
    background-color: #333;
    border-radius: 50%;
    position: absolute;
    transform: translate(-50%, -50%);
}

button {
    padding: 10px 20px;
    margin-top: 10px;
    margin-bottom: 10px;
    border: none;
    border-radius: 5px;
    background-color: #4b6769;
    color: white;
    font-weight: bold;
    font-size: 25px;
    cursor: pointer;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #274142;
}

#totalScore {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin-top: 20px;
}
