body.starlight-bg {
    min-height: 100vh;
    margin: 0;
    background: radial-gradient(ellipse at 50% 30%, #6f43b9 0%, #4326a4 60%, #2c145a 100%);
    color: #fff;
    font-family: "Microsoft JhengHei", "Noto Sans TC", Arial, sans-serif;
    position: relative;
    overflow-x: hidden;
}


header,
footer {
    width: 100%;
}

.center-area {
    max-width: 900px;
    margin: 40px auto;
    background: rgba(30, 21, 54, 0.98);
    border-radius: 24px;
    box-shadow: 0 6px 36px 2px rgba(76, 0, 152, 0.24);
    padding: 48px 16px 36px 16px;
    text-align: center;
    position: relative;
}

h1 {
    font-size: 2.4rem;
    margin: 0 0 32px 0;
    letter-spacing: 0.08em;
    text-align: center;
    font-weight: 700;
    background: linear-gradient(90deg, #caa8ff 0%, #a4b6ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.lottery-btn-group {
    margin-bottom: 24px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
}

.lottery-btn,
.reset-btn {
    min-width: 146px;
    max-width: 170px;
    height: 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
    background: linear-gradient(90deg, #6f43b9, #b198fd 100%);
    border: none;
    border-radius: 20px;
    font-size: 1.15rem;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 16px rgba(87, 0, 161, 0.13);
    transition: background 0.2s, transform 0.15s;
    margin-bottom: 0;
}

.lottery-btn:hover:not([disabled]),
.reset-btn:hover:not([disabled]) {
    background: linear-gradient(90deg, #b198fd, #6f43b9 100%);
    transform: translateY(-2px) scale(1.04);
}

.lottery-btn.disabled,
.lottery-btn:disabled,
.lottery-btn[disabled] {
    background: #8476a7 !important;
    color: #e9e7ee !important;
    cursor: not-allowed !important;
    opacity: 1 !important;
    filter: grayscale(20%);
    box-shadow: none !important;
    border: none;
}

#result {
    margin: 18px 0;
    font-size: 1.35rem;
    font-weight: 700;
    color: #fffdd0;
    letter-spacing: 0.02em;
    text-shadow: 0 1px 10px #6f43b9;
    min-height: 3.1em;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

#pool-accordion {
    margin: 0 auto;
    max-width: 680px;
    min-width: 220px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: center;
}

.accordion-item {
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 1px 6px 1px rgba(100, 54, 196, 0.06);
    margin: 0 auto;
    width: 100%;
    max-width: 660px;
    text-align: center;
}

.accordion-btn {
    width: 100%;
    text-align: center;
    padding: 14px 0;
    font-size: 1.09rem;
    color: #fff;
    background: none;
    border: none;
    outline: none;
    font-weight: bold;
    letter-spacing: 0.03em;
    cursor: pointer;
    border-radius: 12px;
    transition: background 0.14s;
}

.accordion-btn:hover {
    background: rgba(155, 148, 255, 0.17);
}

.accordion-panel {
    display: none;
    background: rgba(255, 255, 255, 0.07);
    border-radius: 0 0 12px 12px;
    padding: 10px 0 12px 0;
    font-size: 1.02rem;
    color: #fff;
    text-align: center;
    overflow-x: auto;
    word-break: break-all;
}

.accordion-panel ul {
    list-style: disc inside;
    padding: 0 0 0 22px;
    margin: 0 auto;
    font-size: 1.08rem;
    color: #c8d6fa;
    background: none;
    width: 99%;
    text-align: left;
    display: block;
}

.accordion-panel li {
    margin: 6px 0;
    line-height: 1.9;
    font-weight: 500;
}

.prize-line {
    color: #c8d6fa;
    font-size: 1.06rem;
    letter-spacing: 0.01em;
}

.prize-name {
    flex: 1 1 70%;
    text-align: left;
    padding-right: 8px;
}

.prize-chance {
    flex: 0 0 auto;
    min-width: 58px;
    text-align: right;
    letter-spacing: 0.02em;
}

/* -------------  統計表  ------------- */
.prize-table-wrap {
    margin: 28px auto 12px auto;
    max-width: 600px;
    background: rgba(70, 40, 170, 0.09);
    border-radius: 16px;
    box-shadow: 0 1px 8px 2px rgba(50, 30, 140, 0.09);
    padding: 18px 12px 12px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.prize-table-title,
.stat-area-title {
    font-size: 1.16rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 4px;
    color: #ffd;
}

.prize-table {
    margin: 0 auto 14px auto !important;
    width: 95%;
    max-width: 560px;
    min-width: 280px;
    font-size: 1.08rem;
    background: rgba(255, 255, 255, 0.01);
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 12px;
    box-shadow: 0 2px 18px 1px rgba(90, 60, 185, 0.06);
}

.prize-table th,
.prize-table td {
    border-bottom: 1px solid #403e72;
    padding: 7px 9px;
    white-space: nowrap;
    text-align: center;
    vertical-align: middle;
    font-weight: 500;
    font-size: 1.04rem;
    color: #ffe;
}

.prize-table th {
    background: rgba(160, 170, 255, 0.12);
    color: #c7cfff;
    border-radius: 10px 10px 0 0;
    font-weight: 700;
}

.prize-table td {
    background: rgba(100, 80, 160, 0.14);
    border-bottom: 1px solid #403e72;
}

.prize-table tr:last-child td {
    border-bottom: none;
}

.prize-table td:nth-child(2),
.prize-table th:nth-child(2) {
    width: 90px;
    text-align: right;
}

.prize-table td:nth-child(3),
.prize-table th:nth-child(3) {
    width: 110px;
    text-align: right;
}

.prize-price-input,
#main-price-input {
    width: 65px;
    padding: 3px 7px;
    font-size: 1.05rem;
    text-align: right;
    border-radius: 6px;
    border: 1px solid #a89cec;
    background: #20194b;
    color: #ffd;
}

.prize-price-input:focus,
#main-price-input:focus {
    border-color: #ffde81;
    outline: 2px solid #c0a9ff;
    background: #2a245d;
}

@media (max-width: 1000px) {

    .center-area,
    #pool-accordion,
    .accordion-item {
        max-width: 98vw;
    }
}

@media (max-width: 600px) {
    h1 {
        font-size: 1.45rem;
    }

    .lottery-btn,
    .reset-btn {
        padding: 10px 14px;
        font-size: 1rem;
    }

    .center-area {
        padding: 14px 1vw 12px 1vw;
        margin: 18px 2px 22px 2px;
    }

    #pool-accordion,
    .accordion-item {
        max-width: 99vw;
        min-width: unset;
    }

    .prize-table,
    .prize-table-wrap {
        min-width: 0;
        max-width: 99vw;
        font-size: 0.92rem;
    }
}

#star-canvas {
    position: fixed;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
}

.center-area,
header,
main,
footer {
    position: relative;
    z-index: 1;
}

.lottery-btn .special-qty {
    font-size: 1.06em;
    color: #ffe082;
    margin-left: 2px;
}

.lottery-btn {
    white-space: pre-line !important;
}


/* 廣告CSS */
/* 300x600 兩側固定，對齊中間 900px 主區塊的外側 */
.ad-side {
    position: fixed;
    top: 160px;
    /* 視需要微調與導覽列距離 */
    width: 300px;
    height: 600px;
    z-index: 10;
}

/* 依據中心點(50%)，往左右各推：主區塊寬 900/2，再加廣告與間距(300+100) */
.ad-left {
    left: calc(50% - 900px/2 - 400px);
}

.ad-right {
    right: calc(50% - 900px/2 - 400px);
}

/* 測試用外框 */
.ad-mock {
    width: 100%;
    height: 100%;
    background: #2b2b2b;
    border: 2px dashed #888;
    border-radius: 12px;
    color: #bbb;
    display: flex;
    align-items: center;
    justify-content: center;
    font: 600 18px/1.2 "Noto Sans TC", sans-serif;
    box-shadow: 0 10px 30px #0006;
}

/* 螢幕寬度不夠就自動隱藏（避免擠壓內容） */
@media (max-width: 1400px) {
    .ad-side {
        display: none;
    }
}