body {
    background-color: #0d1a26;
    color: #e0e0e0;
    font-family: 'Arial', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
}

.container {
    width: 90%;
    max-width: 800px;
    text-align: center;
    padding: 20px;
}

.lottery-machine {
    position: relative;
    width: 100%;
    height: auto;
    background-color: #1a2a38;
    /* 原有的黃色邊框被修改為發光的科技感邊框 */
    border: 5px solid #00c2ff;
    box-shadow: 0 0 15px #00c2ff, 0 0 30px #00c2ff, 0 0 45px #00c2ff, inset 0 0 15px #00c2ff;
    border-radius: 10px;
    margin-bottom: 20px;
    padding: 10px;
    transition: all 0.5s ease-in-out;
}

.prize-window {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 10px;
    height: auto;
    align-items: center;
}

.prize-item {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    padding: 10px;
    text-align: center;
    border-radius: 8px;
    background-color: transparent;
    border: 3px solid #1abc9c;
    transition: all 0.2s ease-in-out;
    min-height: 120px;
}

.prize-window .prize-item:only-child {
    grid-column: 1 / -1;
}

.prize-item img {
    max-height: 70%;
    max-width: 90%;
    object-fit: contain;
    margin-bottom: 5px;
}

.prize-item span {
    font-size: 0.9em;
    font-weight: bold;
    color: #fff;
    text-shadow: 1px 1px 2px #000;
    white-space: normal;
    word-break: break-all;
}

/* 抽獎時的閃爍效果改為科技感光暈 */
.prize-item.glowing {
    border-color: #f39c12;
    animation: glowing 0.5s infinite alternate;
}

@keyframes glowing {
    from {
        box-shadow: 0 0 5px #f39c12, 0 0 10px #f39c12;
    }

    to {
        box-shadow: 0 0 20px #f39c12, 0 0 30px #f39c12;
    }
}

/* 中獎時的特效 */
.prize-item.win-glowing {
    border-color: #3498db;
    animation: win-glowing 0.5s infinite alternate;
}

@keyframes win-glowing {
    from {
        box-shadow: 0 0 10px #3498db, 0 0 20px #3498db;
    }

    to {
        box-shadow: 0 0 30px #3498db, 0 0 40px #3498db, 0 0 50px #3498db;
    }
}

.indicator {
    display: none;
}

.input-area {
    margin-top: 20px;
}

.input-area input {
    padding: 12px;
    font-size: 1.2em;
    border: 2px solid #1abc9c;
    border-radius: 5px;
    background-color: #2c3e50;
    color: white;
    width: calc(100% - 20px);
    max-width: 300px;
    margin-bottom: 15px;
}

#auth-modal input {
    width: calc(100% - 20px);
    max-width: 300px;
    padding: 12px;
    font-size: 1.2em;
    border: 2px solid #1abc9c;
    border-radius: 5px;
    background-color: #2c3e50;
    color: white;
    margin-bottom: 15px;
}

.input-area button, .modal-content button {
    padding: 10px 20px;
    font-size: 1.2em;
    font-weight: bold;
    color: white;
    background-color: #e74c3c;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
    flex: 1 1 auto;
    min-width: 150px;
    margin: 5px 0;
}

.input-area button:hover, .modal-content button:hover {
    background-color: #c0392b;
}

.view-coupons-button {
    background-color: #3498db;
}

.view-coupons-button:hover {
    background-color: #2980b9;
}

.button-group {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}


/* Modal 樣式 */
.modal {
    display: none; /* 預設隱藏 */
    position: fixed;
    z-index: 10;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #1a2a38;
    padding: 30px;
    border-radius: 10px;
    border: 2px solid #00c2ff;
    width: 90%;
    max-width: 500px;
    position: relative;
    color: white;
    text-align: center;
    box-shadow: 0 0 10px #00c2ff;
}

.modal-content h2 {
    margin-top: 0;
    color: #1abc9c;
}

.close-button {
    color: #aaa;
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-button:hover,
.close-button:focus {
    color: white;
    text-decoration: none;
    cursor: pointer;
}

.error-message {
    color: #e74c3c;
}

/* 抽獎結果 */
.prize-info {
    margin-top: 20px;
}

.prize-info img {
    max-width: 150px;
    height: auto;
    border-radius: 8px;
}

.prize-info p {
    font-size: 1.2em;
    margin: 10px 0;
}

/* 我的優惠券 */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.points-summary {
    font-size: 1.2em;
    font-weight: bold;
    color: #ffd700;
}

.coupons-nav {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    border-bottom: 2px solid #34495e;
    flex-wrap: wrap; /* 新增此行 */
}

.coupons-nav button {
    background: none;
    border: none;
    color: #e0e0e0;
    font-size: 1em;
    padding: 10px 15px;
    cursor: pointer;
    transition: color 0.3s, border-bottom 0.3s;
    border-bottom: 2px solid transparent;
}

.coupons-nav button:hover {
    color: #1abc9c;
}

.coupons-nav button.active {
    color: #1abc9c;
    border-bottom: 2px solid #1abc9c;
}

.coupons-list {
    text-align: left;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 10px;
    margin-bottom: 20px;
}

.coupon-item {
    background-color: #2c3e50;
    border: 1px solid #34495e;
    border-radius: 8px;
    margin-bottom: 15px;
    padding: 15px;
    display: flex;
    align-items: center;
    transition: background-color 0.3s, border-color 0.3s;
    cursor: pointer;
}

.coupon-item:hover {
    background-color: #34495e;
}

/* 選取時的樣式 */
.coupon-item.selected {
    border-color: #1abc9c;
    background-color: rgba(26, 188, 156, 0.2);
}

.coupon-item-checkbox {
    margin-right: 15px;
}

.coupon-prize-info {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    margin-right: 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.coupon-prize-info img {
    max-width: 100%;
    max-height: 100%;
    height: auto;
    object-fit: contain;
    border-radius: 5px;
}

.coupon-prize-name {
    font-weight: bold;
    font-size: 0.9em;
    margin-top: 5px;
}

.coupon-details {
    flex-grow: 1;
}

.coupon-details p {
    margin: 5px 0;
    font-size: 0.9em;
}

.coupon-status {
    font-weight: bold;
    color: #f1c40f; /* 預設黃色 */
}

.coupon-unused .coupon-status {
    color: #2ecc71; /* 綠色 */
}

.coupon-pending .coupon-status {
    color: #f39c12; /* 橘色 */
}

.coupon-used .coupon-status {
    color: #95a5a6; /* 灰色 */
}

.coupon-expired .coupon-status {
    color: #e74c3c; /* 紅色 */
}

/* 兌換獎項資訊 */
.redeemable-prizes-list {
    text-align: left;
    max-height: 600px;
    overflow-y: auto;
    padding-right: 10px;
}

.redeemable-prize-item {
    background-color: #2c3e50;
    border: 1px solid #34495e;
    border-radius: 8px;
    margin-bottom: 15px;
    padding: 15px;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    cursor: pointer; /* 新增鼠標指標 */
}

.redeemable-prize-item:hover {
    background-color: #0691cc;
}

.redeemable-prize-visual {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    margin-right: 20px;
    text-align: center;
}

.redeemable-prize-visual img {
    max-width: 100%;
    max-height: 100%;
    height: auto;
    object-fit: contain;
    border-radius: 5px;
}

.redeemable-prize-details {
    flex-grow: 1;
}

.redeemable-prize-item h3 {
    margin-top: 0;
    color: #f1c40f;
}

.redeemable-prize-item p {
    margin: 5px 0;
}

.redeemable-prize-description {
    font-size: 0.9em;
    color: #bdc3c7;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #34495e;
    white-space: normal;
    word-break: break-word;
}

.redeem-selected-button {
    background-color: #1abc9c !important;
    width: 100%;
    margin-top: 10px;
    display: none;
}

.redeem-selected-button:hover {
    background-color: #16a085 !important;
}

.redeem-selected-button:disabled {
    background-color: #555 !important;
    cursor: not-allowed;
}

/* ===== 新增兌換購物車樣式 ===== */
#redemption-cart-container {
    border: 2px dashed #f39c12;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 8px;
    text-align: left;
}

.redemption-cart-item {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.redemption-cart-item img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    margin-right: 15px;
    border-radius: 5px;
}

.redemption-cart-details h4 {
    margin: 0 0 5px 0;
    color: #f1c40f;
}

.redemption-cart-details p {
    margin: 0;
    font-size: 0.9em;
}

.redemption-summary {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #34495e;
    text-align: center;
    font-size: 1.1em;
}

.points-sufficient {
    color: #2ecc71;
}

.points-insufficient {
    color: #e74c3c;
}

#confirm-redemption-button {
    background-color: #27ae60;
    width: 100%;
    margin-top: 15px;
}
#confirm-redemption-button:hover {
    background-color: #229954;
}
#confirm-redemption-button:disabled {
    background-color: #555 !important;
    cursor: not-allowed;
}
/* ===== 新增結束 ===== */

/* ===== 新增獎項記錄表格樣式 ===== */
.history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
}

.history-table th, .history-table td {
    border-bottom: 1px solid #34495e;
    padding: 10px 5px;
    text-align: center;
}

.history-table th {
    color: #1abc9c;
    font-weight: bold;
}

.history-table td {
    color: #e0e0e0;
}

.history-table .status-collected {
    color: #2ecc71; /* Green */
}

.history-table .status-uncollected {
    color: #f39c12; /* Orange */
    font-weight: bold;
}
/* ===== 新增結束 ===== */