


/* Header */
.lottery-header{
    display: flex;
    align-items: center;
    gap: 16px;
    padding:10px 0 30px;
    flex-wrap: wrap;
}

.lottery-section {
    background: #F5F7FA;
    padding:30px 0;
}

.lottery-header-icon {
    width: 22px;
    height: 22px;
}

.lottery-header-title {
    font-size: 28px;
    font-weight: 700;
    color: #101820;
}

.lottery-header-subtitle {
    font-size: 13px;
    color: #717171;
}

/* Main Content */
.main-content {
    display: flex;
    gap: 32px;
    align-items: flex-start;
    flex-wrap: wrap;
}

/* Lottery Wheel Container */
.wheel-container {
    width: 100%;
    max-width: 656px;
    aspect-ratio: 656 / 414;
    background: #F5F7FA;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 10px;
    flex: 1 1 400px;
    min-width: 280px;
}

.wheel-wrapper {
    position: relative;
    /* 同时受内容区宽度和高度约束，取较小值防止溢出 */
    width: min(100% - 20px, calc(100% * 414 / 656 - 16px));
    max-width: 410px;
    aspect-ratio: 1;
}

/* Outer ring */
.wheel-outer-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #014985;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Canvas wheel */
.wheel-canvas-wrapper {
    position: relative;
    width: 96.1%;
    height: 96.1%;
    border-radius: 50%;
    overflow: hidden;
}

#wheelCanvas {
    width: 100%;
    height: 100%;
}

/* Pointer at top：初始不显示，抽奖停稳后加 .show 才出现 */
.wheel-pointer {
    position: absolute;
    top: -2px;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
    z-index: 10;
    width: 0;
    height: 0;
    border-left: 14px solid transparent;
    border-right: 14px solid transparent;
    border-top: 28px solid #BE1200;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.wheel-pointer.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Center button */
.center-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 36.3%;
    height: 36.3%;
    border-radius: 50%;
    background: #BE1200;
    border: 2px solid #fff;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 5;
    box-shadow: 0 4px 15px rgba(190, 18, 0, 0.4);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.center-btn:hover {
    transform: translate(-50%, -50%) scale(1.05);
    box-shadow: 0 6px 20px rgba(190, 18, 0, 0.5);
}

.center-btn:active {
    transform: translate(-50%, -50%) scale(0.97);
}

.center-btn.disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.center-btn-text {
    font-size: clamp(14px, 2.3vw, 23px);
    font-weight: 700;
    color: #fff;
    line-height: 1.4;
    text-align: center;
}

.center-btn-sub {
    font-size: clamp(10px, 1.3vw, 13px);
    color: #fff;
    margin-top: 2px;
}

/* Winner List Panel */
.winner-panel {
    flex: 0 1 366px;
    min-width: 260px;
    min-height: 300px;
    background: #fff;
    border: 1px solid #E0E1E6;
    border-radius: 12px;
    padding: 16px 20px;
    margin-top:20px;
}

.winner-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.winner-panel-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 700;
    color: #101820;
}

.winner-panel-title svg {
    width: 18px;
    height: 18px;
}

.rolling-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #E8F4EC;
    border-radius: 12px;
    padding: 4px 10px;
    font-size: 12px;
    color: #16A34A;
}

.rolling-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22C55E;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Winner list scrolling */
.winner-list-wrapper {
    height: 300px;
    overflow: hidden;
    position: relative;
}

.winner-list-scroll {
    animation: scrollUp 12s linear infinite;
}

/* 行数不足一屏（含空态）时由 JS 加上，避免内容往上飘走、下半屏留白 */
.winner-list-scroll.no-scroll {
    animation: none;
}

.winner-list-scroll:hover {
    animation-play-state: paused;
}

@keyframes scrollUp {
    0% { transform: translateY(0); }
    100% { transform: translateY(-50%); }
}

.winner-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 38px;
    padding: 0 0;
}

/* 自己刚中奖插入的那条，做个底色便于辨认 */
.winner-item.new {
    background: #FFF9E6;
    border-radius: 6px;
    padding: 0 8px;
}

.winner-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 300px;
    font-size: 13px;
    color: #9CA3AF;
}

.winner-name {
    font-size: 13px;
    font-weight: 500;
    color: #101820;
}

.winner-prize {
    font-size: 13px;
    font-weight: 500;
    color: #0067B9;
}

/* Modal Overlay */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100;
    align-items: center;
    justify-content: center;
}

.modal-overlay.show {
    display: flex;
}

.modal-content {
    background: #fff;
    border-radius: 16px;
    padding: 40px 60px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-content.win .modal-emoji {
    font-size: 48px;
    margin-bottom: 16px;
}

.modal-content.lose .modal-emoji {
    font-size: 48px;
    margin-bottom: 16px;
}

.modal-title {
    font-size: 24px;
    font-weight: 700;
    color: #101820;
    margin-bottom: 8px;
}

.modal-subtitle {
    font-size: 14px;
    color: #717171;
    margin-bottom: 24px;
}

.modal-btn {
    background: #0067B9;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 32px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    font-family: 'Noto Sans SC', sans-serif;
    transition: background 0.2s;
}

.modal-btn:hover {
    background: #005599;
}

/* Highlight effect on winning segment */
.wheel-canvas-wrapper.highlight::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    box-shadow: inset 0 0 30px rgba(255, 215, 0, 0.5);
    pointer-events: none;
    z-index: 2;
}

/* Confetti */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 99;
}

.thank-you{
    color:#666;
    font-size: 14px;
    text-align: center;
    margin-top: 20px;
}

/* 未抽满 3 次时隐藏（服务端渲染 + lottery.js 揭示） */
.thank-you.hide {
    display: none;
}

/* ===== Responsive ===== */
@media (max-width: 1200px) {
    .wheel-container {
        max-width: 560px;
    }
    .winner-panel {
        flex: 0 1 320px;
    }
}

@media (max-width: 992px) {
    .main-content {
        justify-content: center;
    }
    .wheel-container {
        max-width: 500px;
        flex: 1 1 340px;
    }
    .winner-panel {
        flex: 0 1 100%;
        min-width: unset;
    }
    .lottery-header-title {
        font-size: 24px;
    }
}

@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }
    .wheel-container {
        max-width: 100%;
        flex: unset;
        width: 100%;
    }
    .winner-panel {
        width: 100%;
        flex: unset;
    }
    .lottery-header {
        gap: 10px;
        padding: 10px 0 20px;
    }
    .lottery-header-title {
        font-size: 22px;
    }
    .lottery-header-subtitle {
        font-size: 12px;
        width: 100%;
    }
    .modal-content {
        padding: 30px 24px;
        margin: 0 16px;
    }
}

@media (max-width: 480px) {
    .lottery-section {
        padding: 20px 0;
    }
    .lottery-header-title {
        font-size: 20px;
    }
    .lottery-header-subtitle {
        font-size: 11px;
    }
    .wheel-container {
        padding: 6px;
    }
    .wheel-wrapper {
        width: min(100% - 12px, calc(100% * 414 / 656 - 12px));
        max-width: 410px;
    }
    .winner-panel {
        padding: 12px 14px;
    }
    .winner-panel-title {
        font-size: 16px;
    }
    .winner-list-wrapper {
        height: 180px;
    }
    .modal-content {
        padding: 24px 16px;
        margin: 0 12px;
    }
    .modal-title {
        font-size: 20px;
    }
    .modal-subtitle {
        font-size: 13px;
    }
}
