body {
    font-family: Arial, sans-serif;
    margin: 0;
    background-color: #ffe0b2;
}
.banner-container {
    background-color: #2e7d32;
    color: white;
    padding: 15px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.banner-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.6;
}
.banner-text {
    position: relative;
    font-size: 1.5em;
    font-weight: bold;
    z-index: 1;
}
.container {
    width: 90%;
    max-width: 1000px;
    margin: 20px auto;
    text-align: center;
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    position: relative;
    display: flex;
    flex-direction: column; /* 允許項目垂直堆疊 */
}

/* 主內容區佈局 */
.main-content {
    display: flex;
    flex-direction: row;
    gap: 20px;
    justify-content: center;
    align-items: flex-start;
    margin: 20px 0;
}

/* 圓形抽獎區塊樣式 - 替換 grid-lottery 樣式 */
.circular-lottery-container {
    width: 60%;
    max-width: 500px; 
    min-width: 300px;
    aspect-ratio: 1/1; /* 保持正方形比例 */
    position: relative;
    margin: 20px auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* style.css (修改) */
.lottery-frame {
    position: relative;
    width: 100%;
    height: 100%;
    
    /* === 新增以下三行來設置底圖 === */
    background-image: url('image/lottery_background.png'); /* 請將 lottery_background.png 換成您的圖片檔名 */
    background-size: cover; /* 讓圖片覆蓋整個區域 */
    background-position: center; /* 讓圖片居中 */
    /* ============================ */
    
    border-radius: 15px; 
    padding: 10px; 
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}
/* 圓形獎項佈局 */
.circular-lottery {
    position: relative;
    width: 90%;
    height: 90%;
    /* 這裡使用 Flex 佈局或絕對定位來輔助定位圓形獎項 */
}

.circular-item {
    position: absolute;
    /* *** 關鍵修改 1: 放大 1.5 倍 (150px * 1.5 = 225px) *** */
    width: 225px; /* 圓形獎項的直徑 */
    height: 225px;
    background-color: #fff;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    font-size: 0.9em;
    color: #333;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: box-shadow 0.1s ease-in-out;
    border: 3px solid transparent; /* 預留邊框給高亮 */
    /* *** 新增：隱藏超出圖片的部分，確保圖片填滿後不會溢出圓形 *** */
    overflow: hidden; 
}

/* 使用 CSS 定位五個圓形獎項（梅花/圓形分佈） */
/* 5個點的圓形佈局，角度分別為 -90, -18, 54, 126, 198 (從頂部開始順時針) */
.circular-item:nth-child(1) { /* 一獎 (頂部) */
    top: 50%;
    left: 50%;
    /* *** 關鍵修改 2: 放大 1.5 倍 (150px * 1.5 = 225px) *** */
    transform: translate(-50%, -50%) translate(0, -225px); /* 向上移動半徑 */
}
.circular-item:nth-child(2) { /* 二獎 (右上方) */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(72deg) translate(0, -225px) rotate(-72deg);
}
.circular-item:nth-child(3) { /* 三獎 (右下方) */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(144deg) translate(0, -225px) rotate(-144deg);
}
.circular-item:nth-child(4) { /* 四獎 (左下方) */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(216deg) translate(0, -225px) rotate(-216deg);
}
.circular-item:nth-child(5) { /* 五獎 (左上方) */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(288deg) translate(0, -225px) rotate(-288deg);
}


/* 獎項圖片樣式 (已修正為填滿) */
.circular-item img {
    /* *** 關鍵修改 3: 圖片填滿 100% 圓形區塊 *** */
    width: 100%; /* 填滿 circular-item 寬度 (225px) */
    height: 100%; /* 填滿 circular-item 高度 (225px) */
    object-fit: cover; /* 關鍵：確保圖片填滿，裁剪多餘部分 */
    border-radius: 50%;
    margin-bottom: 0; /* 移除底部間距 */
    border: none; /* 移除邊框 */
}
.circular-item .prize-title {
    /* 由於圖片已填滿，文字可能需要調整位置或隱藏 */
    font-size: 0.8em;
    text-align: center;
    line-height: 1.2;
    position: absolute; /* 讓標題懸浮在圖片上方 */
    bottom: 5px; /* 調整標題位置 */
    background-color: rgba(255, 255, 255, 0.7);
    padding: 2px 5px;
    border-radius: 3px;
    z-index: 2; /* 確保文字在圖片上方 */
}

/* 高亮和閃爍動畫 */
.circular-item.active-blink {
    border: 3px solid #ffeb3b; /* 閃爍時的黃色邊框 */
    box-shadow: 0 0 15px #ffeb3b;
}

/* 調整中獎高亮效果為七彩光暈 */
.circular-item.highlight {
    border: 5px solid white; /* 邊框改為白色，讓光暈更突出 */
    /* 放大效果 */
    transform: scale(1.1); 
    /* 七彩光暈動畫 */
    animation: finalHighlight 1s infinite alternate, 
               rainbowGlow 1.5s infinite alternate; /* 新增七彩光暈動畫 */
}
/* 放大時的圓形定位校正 (需要針對每個子元素調整 transform 屬性) */
/* 由於這裡的定位複雜，簡單地使用 scale 會導致微小偏移，但為了視覺效果暫時接受 */
.circular-item:nth-child(1).highlight {
     transform: translate(-50%, -50%) translate(0, -225px) scale(1.1);
}
.circular-item:nth-child(2).highlight {
    transform: translate(-50%, -50%) rotate(72deg) translate(0, -225px) rotate(-72deg) scale(1.1);
}
.circular-item:nth-child(3).highlight {
    transform: translate(-50%, -50%) rotate(144deg) translate(0, -225px) rotate(-144deg) scale(1.1);
}
.circular-item:nth-child(4).highlight {
    transform: translate(-50%, -50%) rotate(216deg) translate(0, -225px) rotate(-216deg) scale(1.1);
}
.circular-item:nth-child(5).highlight {
    transform: translate(-50%, -50%) rotate(288deg) translate(0, -225px) rotate(-288deg) scale(1.1);
}

@keyframes finalHighlight {
    0% { box-shadow: 0 0 10px rgba(255, 255, 255, 0.8); }
    100% { box-shadow: 0 0 30px rgba(255, 255, 255, 1); }
}

@keyframes rainbowGlow {
    0% { box-shadow: 0 0 20px #ff0000, 0 0 30px #ff00ff; } /* 紅/紫 */
    25% { box-shadow: 0 0 20px #ff7f00, 0 0 30px #0000ff; } /* 橙/藍 */
    50% { box-shadow: 0 0 20px #ffff00, 0 0 30px #00ffff; } /* 黃/青 */
    75% { box-shadow: 0 0 20px #00ff00, 0 0 30px #ff0000; } /* 綠/紅 */
    100% { box-shadow: 0 0 20px #0000ff, 0 0 30px #ff00ff; } /* 藍/紫 */
}

/* 中間抽獎按鈕的樣式 - 保持圓形，尺寸與獎項圓圈協調 */
.draw-button-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120px; /* 按鈕直徑 */
    height: 120px;
    background-color: #673ab7; 
    color: white;
    border-radius: 50%; 
    font-size: 1.5em; /* 放大字體 */
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    border: 5px solid #ffeb3b; 
    box-shadow: 0 0 15px rgba(0,0,0,0.8);
    transition: background-color 0.3s ease, transform 0.1s ease;
    z-index: 10;
}

.draw-button-center:hover {
    background-color: #512da8;
    transform: translate(-50%, -50%) scale(1.05);
}

.draw-button-center:active {
    transform: translate(-50%, -50%) scale(0.95);
}

/* 燈光效果 (保留，但移除不必要的 grid 樣式) */
.lottery-frame .grid-lottery-lights {
    /* 這裡保留燈光效果的簡單動畫，可以根據需要調整 */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 15px;
    box-shadow: 
        0 0 5px #ffeb3b,
        0 0 10px #ffeb3b inset;
    pointer-events: none;
    animation: lightBlink 1s infinite alternate; 
}


/* 左側獎項列表樣式 - 保持不變 (僅移除已移除的獎項) */
.prize-list-left {
    width: 40%;
    min-width: 250px;
    background-color: #f8f8f8;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.prize-list-title {
    text-align: center;
    font-size: 1.2em;
    color: #2e7d32;
    margin-bottom: 15px;
    font-weight: bold;
}
.prize-items-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.prize-item { 
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    width: 100%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    font-size: 0.9em;
    text-align: left;
}
.prize-item:nth-child(1) {
    border-left: 4px solid #ffd700; /* 金色 */
}
.prize-item:nth-child(2) {
    border-left: 4px solid #c0c0c0; /* 銀色 */
}
.prize-item:nth-child(3) {
    border-left: 4px solid #cd7f32; /* 銅色 */
}
.prize-item:nth-child(4),
.prize-item:nth-child(5) {
    border-left: 4px solid #2e7d32; /* 其他獎項綠色 */
}


/* --- 其他樣式保持不變或僅微調 --- */
#input-section {
    margin-bottom: 20px;
    background-color: #f8f8f8;
    padding: 20px;
    border-radius: 8px;
}
#result-section {
    margin-top: 20px;
    font-size: 1.2em;
    font-weight: bold;
    display: none;
    position: relative;
    background-color: #f8f8f8;
    padding: 20px;
    border-radius: 8px;
}
.error-message {
    color: #d32f2f;
    margin-top: 10px;
}
.repeated-prize {
    color: orange;
    font-weight: bold;
}
.finished-message {
    color: #2e7d32;
    font-weight: bold;
    margin-top: 10px;
    display: none;
}
.prize-history {
    margin-top: 10px;
    white-space: pre-line;
    text-align: left;
    background-color: #fff;
    padding: 15px;
    border-radius: 5px;
}
/* 移除 winning-effect 的光暈動畫，因為已在 .highlight 中實作 */
.winning-effect {
    display: none; 
} 

#draw-result-container {
    position: relative;
    margin-bottom: 15px;
}
#query-link {
    margin-top: 20px;
}
#query-link a {
    color: #2e7d32;
    text-decoration: none;
    font-weight: bold;
}
#query-link a:hover {
    text-decoration: underline;
}

/* 表單元素樣式 */
input[type="text"] {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 100%;
    max-width: 300px;
    margin: 5px 0;
}
label {
    display: block;
    margin-top: 10px;
    text-align: left;
    font-weight: bold;
}
button {
    padding: 10px 20px;
    font-size: 1em;
    cursor: pointer;
    margin: 10px 5px;
    border: none;
    border-radius: 4px;
    transition: background-color 0.3s;
}
#verify-button {
    background-color: #2e7d32;
    color: white;
}
#verify-button:hover {
    background-color: #1b5e20;
}
/* 調整 reset-button 樣式 */
.reset-button {
    background-color: #d32f2f;
    color: white;
    width: 100%; /* 讓它佔滿底部寬度 */
    max-width: 300px; /* 限制寬度 */
    margin: 20px auto 10px auto; /* 置中並增加上方間距 */
    display: block;
}
.reset-button:hover {
    background-color: #b71c1c;
}

/* --- 新增 Modal 樣式 --- */
.modal {
    display: none; /* 預設隱藏 */
    position: fixed; /* 保持在視窗上方 */
    z-index: 20; /* 確保在所有內容之上 */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.6); /* 半透明黑色背景 */
    backdrop-filter: blur(5px); /* 輕微模糊背景 */
}

.modal-content {
    background-color: #fefefe;
    margin: 10% auto; /* 距離頂部 10% 處居中 */
    padding: 30px;
    border: 1px solid #888;
    width: 90%;
    max-width: 400px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    text-align: center;
    position: relative;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-50px); }
    to { opacity: 1; transform: translateY(0); }
}

.close-button {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close-button:hover,
.close-button:focus {
    color: #000;
    text-decoration: none;
    cursor: pointer;
}

#modal-title {
    color: #673ab7;
    margin-bottom: 20px;
    font-size: 1.8em;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.modal-prize-image {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 50%;
    border: 5px solid #ffeb3b;
    margin-bottom: 15px;
    box-shadow: 0 0 10px rgba(0,0,0,0.2);
}

.modal-prize-name {
    font-size: 1.2em;
    font-weight: bold;
    color: #333;
    margin-bottom: 20px;
}

.modal-close-button {
    background-color: #673ab7;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
}

.modal-close-button:hover {
    background-color: #512da8;
}

/* 響應式設計調整 */
@media (max-width: 768px) {
    .container {
        width: 95%;
        padding: 15px;
    }
    .main-content {
        flex-direction: column;
        align-items: center;
    }
    .circular-lottery-container, 
    .prize-list-left {
        width: 100%;
        max-width: 400px; /* 縮小以適應圓形 */
    }
    .banner-text {
        font-size: 1.2em;
    }
    .circular-item { /* 獎項圓形縮小 */
        /* *** 關鍵修改 4: 放大 1.5 倍 (100px * 1.5 = 150px) *** */
        width: 150px;
        height: 150px;
        overflow: hidden; /* 確保圖片不溢出 */
    }
    .circular-item:nth-child(1) {
        /* *** 關鍵修改 5: 放大 1.5 倍 (100px * 1.5 = 150px) *** */
        transform: translate(-50%, -50%) translate(0, -150px); 
    }
    .circular-item:nth-child(2) {
        transform: translate(-50%, -50%) rotate(72deg) translate(0, -150px) rotate(-72deg);
    }
    .circular-item:nth-child(3) {
        transform: translate(-50%, -50%) rotate(144deg) translate(0, -150px) rotate(-144deg);
    }
    .circular-item:nth-child(4) {
        transform: translate(-50%, -50%) rotate(216deg) translate(0, -150px) rotate(-216deg);
    }
    .circular-item:nth-child(5) {
        transform: translate(-50%, -50%) rotate(288deg) translate(0, -150px) rotate(-288deg);
    }
    /* 針對響應式設計調整 .highlight 效果 */
    .circular-item:nth-child(1).highlight {
        transform: translate(-50%, -50%) translate(0, -150px) scale(1.1);
    }
    .circular-item:nth-child(2).highlight {
        transform: translate(-50%, -50%) rotate(72deg) translate(0, -150px) rotate(-72deg) scale(1.1);
    }
    .circular-item:nth-child(3).highlight {
        transform: translate(-50%, -50%) rotate(144deg) translate(0, -150px) rotate(-144deg) scale(1.1);
    }
    .circular-item:nth-child(4).highlight {
        transform: translate(-50%, -50%) rotate(216deg) translate(0, -150px) rotate(-216deg) scale(1.1);
    }
    .circular-item:nth-child(5).highlight {
        transform: translate(-50%, -50%) rotate(288deg) translate(0, -150px) rotate(-288deg) scale(1.1);
    }
    
    .circular-item img {
        /* *** 關鍵修改 6: 圖片填滿 100% 圓形區塊 *** */
        width: 100%; 
        height: 100%; 
        object-fit: cover; /* 確保圖片填滿 */
    }
    .draw-button-center { /* 按鈕縮小 */
        width: 80px;
        height: 80px;
        font-size: 1.2em;
        border-width: 3px;
    }
    .prize-item { 
        width: 100%;
    }
    #input-section input {
        width: 100%;
    }
    /* 保持 button 樣式，reset button 已被單獨調整 */
}

@media (max-width: 480px) {
    .banner-text {
        font-size: 1em;
    }
    .circular-item { 
        /* *** 關鍵修改 7: 放大 1.5 倍 (60px * 1.5 = 90px) *** */
        width: 90px;
        height: 90px;
        overflow: hidden; /* 確保圖片不溢出 */
    }
    .circular-item:nth-child(1) {
        /* *** 關鍵修改 8: 放大 1.5 倍 (80px * 1.5 = 120px) *** */
        transform: translate(-50%, -50%) translate(0, -120px); 
    }
    .circular-item:nth-child(2) {
        transform: translate(-50%, -50%) rotate(72deg) translate(0, -120px) rotate(-72deg);
    }
    .circular-item:nth-child(3) {
        transform: translate(-50%, -50%) rotate(144deg) translate(0, -120px) rotate(-144deg);
    }
    .circular-item:nth-child(4) {
        transform: translate(-50%, -50%) rotate(216deg) translate(0, -120px) rotate(-216deg);
    }
    .circular-item:nth-child(5) {
        transform: translate(-50%, -50%) rotate(288deg) translate(0, -120px) rotate(-288deg);
    }
     /* 針對響應式設計調整 .highlight 效果 */
    .circular-item:nth-child(1).highlight {
        transform: translate(-50%, -50%) translate(0, -120px) scale(1.1);
    }
    .circular-item:nth-child(2).highlight {
        transform: translate(-50%, -50%) rotate(72deg) translate(0, -120px) rotate(-72deg) scale(1.1);
    }
    .circular-item:nth-child(3).highlight {
        transform: translate(-50%, -50%) rotate(144deg) translate(0, -120px) rotate(-144deg) scale(1.1);
    }
    .circular-item:nth-child(4).highlight {
        transform: translate(-50%, -50%) rotate(216deg) translate(0, -120px) rotate(-216deg) scale(1.1);
    }
    .circular-item:nth-child(5).highlight {
        transform: translate(-50%, -50%) rotate(288deg) translate(0, -120px) rotate(-288deg) scale(1.1);
    }
    
    .circular-item img {
        /* *** 關鍵修改 9: 圖片填滿 100% 圓形區塊 *** */
        width: 100%; 
        height: 100%; 
        object-fit: cover; /* 確保圖片填滿 */
    }
    .draw-button-center { 
        width: 70px;
        height: 70px;
        font-size: 1em;
        border-width: 2px;
    }
    .prize-list-title {
        font-size: 1em;
    }
}