* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

body {
    background-color: #f0f0f0;
    text-align: center;
    display: flex;            /* 使用 Flexbox 布局 */
    justify-content: center;  /* 水平置中 */
    align-items: center;      /* 垂直置中 */
      /* 使 body 高度至少為視口高度，避免內容超出 */
    flex-direction: column;   /* 確保內容從上至下排列 */
}


header {
    background-image: url('背景.jpg');
    background-size: cover;
    background-position: center;
    padding: 60px 0;
    color: #333;
    height: 150px;
    width: 100%;
}

header h1 {
    font-size: 50px;
    color: #1a0a40;
    font-weight: 800;
}

nav {
    background-color: #4b6769;
    padding: 10px;
    width: 100%;
}

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);
}

main {
    padding: 20px;
    width: 30%;
}

.settings {
    margin: 20px;
    font-size: 25px;
}

.settings input{
    height: 25px;
    font-size: 18px;
    margin-right: 10px;
}

.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; /* 增加動畫效果 */
}

.dice.shaking {
    animation: rollDiceAnimation 0.6s infinite; /* 當骰子在變換數字時進行抖動 */
}

.dot {
    width: 20px;
    height: 20px;
    background-color: #333;
    border-radius: 50%;
    position: absolute;
    transform: translate(-50%, -50%);
}


.roll-button {
    background-color: #4CAF50;
    color: white;
    font-size: 20px;
    padding: 15px 32px;
    margin: 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.roll-button:hover {
    background-color: #45a049;
}

#totalScore {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin-top: 20px;
}

button {
    padding: 10px 20px;
    margin-top: 10px;
    border: none;
    border-radius: 5px;
    background-color: #4b6769;
    color: white;
    font-weight: bold;
    font-size: 20px;
    cursor: pointer;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #354f50;
}

.lucky-number-box {
    margin: 8px 0;
    margin-top: 10px;
    padding: 10px;
    border: 3px solid #4b6769;
    border-radius: 10px;
    font-size: 2em;
    font-weight: bold;
    color: #4b6769;
    text-align: center;
    background-color: #f0f8ff;
    width: 150px;
    margin-left: auto;
    margin-right: auto;
}

/* 基本樣式 */
.message {
    font-size: 1.5em;
    font-weight: bold;
    margin-top: 20px;
}

/* 中獎訊息的樣式 */
.win-message {
    color: #4CAF50; /* 綠色 */
    font-weight: bold;
    animation: flash 0.3s infinite alternate; /* 閃爍效果 */
    font-size: 35px;
    margin-top: 10px;
}

/* 未中獎訊息的樣式 */
.lose-message {
    color: rgba(255, 0, 0, 0.8); /* 半透明紅色 */
    font-weight: bold;
    animation: flash 0.8s infinite alternate; /* 閃爍效果 */
    margin-top: 15px;
}

/* 閃爍動畫 */
@keyframes flash {
    0% { opacity: 1; }
    100% { opacity: 0.6; }
}

#totalScoreMessage {
    font-size: 1.5em;
    font-weight: bold;
    color: #333;
    margin-top: 20px;
}

.game-container{
    background-color: #d1d1d1;
    border-radius: 15%;
    height: 450px;
    margin: 5px;
    padding: 20px;
}

/* 視窗背景 */
.modal {
    display: none; /* 預設隱藏 */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
}

/* 視窗內容 */
.modal-content {
    background-color: #fff;
    padding: 20px;
    border-radius: 10px;
    width: 400px;
    text-align: center;
}

.modal h2 {
    font-size: 24px;
    color: #333;
}

.modal p {
    font-size: 18px;
    margin: 10px 0;
}

#closeModalBtn {
    background-color: #4CAF50;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 18px;
}

#closeModalBtn:hover {
    background-color: #45a049;
}

.video-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8); /* 半透明背景 */
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.video-popup video {
    width: 80%;
    max-width: 800px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

 /* 影片容器的基本樣式 */
#videoContainer {
    text-align: center;
    margin-top: 20px;
}

#popupVideo {
    width: 80%; /* 設定影片大小 */
    max-width: 1500px;
    height: auto;
}

.hidden {
    display: none;
}
