/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: #f8f9fa;
    color: #333;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    background-image: linear-gradient(120deg, #84fab0 0%, #8fd3f4 100%);
}

.container {
    background-color: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    max-width: 500px;
    width: 100%;
    text-align: center;
}

h1 {
    color: #ff6b6b;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    font-size: 2.5rem;
}

/* 转盘容器 */
.wheel-container {
    position: relative;
    width: 300px;
    height: 300px;
    margin: 0 auto 30px;
}

/* 转盘样式 - 由脚本生成多个等分区块 */
.wheel {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
    transform-origin: center;
    transition: transform 5s cubic-bezier(0.1, 0.7, 0.1, 1);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.2);
    background: conic-gradient(
        from 270deg,
        #ff6b6b 0deg 180deg,
        #4ecdc4 180deg 288deg,
        #ffe66d 288deg 342deg,
        #1a535c 342deg 360deg
    );
    border: 12px solid rgba(255, 255, 255, 0.8);
    --prize-distance: 135px;
}

.wheel::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 60%;
    height: 60%;
    background: rgba(255, 255, 255, 0.35);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: inset 0 0 15px rgba(255, 255, 255, 0.6);
}

/* 奖品样式 - 沿转盘边缘排布 */
.prize {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120px;
    transform-origin: center center;
    --rotate: 0deg;
    --inverse-rotate: 0deg;
    transform: rotate(var(--rotate));
}

.prize-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, calc(var(--prize-distance) * -1)) rotate(var(--inverse-rotate));
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.prize-1 {
    --rotate: 90deg;
    --inverse-rotate: -90deg;
}

.prize-2 {
    --rotate: 234deg;
    --inverse-rotate: -234deg;
}

.prize-3 {
    --rotate: 315deg;
    --inverse-rotate: -315deg;
}

.prize-4 {
    --rotate: 351deg;
    --inverse-rotate: -351deg;
}

/* 奖品图片 - 极度简化，确保清晰可见 */
.prize img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    background-color: rgba(255, 255, 255, 0.75);
    border-radius: 16px;
    padding: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.segment-label span {
    font-weight: bold;
    color: #ffffff;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.4);
    font-size: 1rem;
}

/* 指针样式 */
.pointer {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 18px solid transparent;
    border-right: 18px solid transparent;
    border-bottom: 36px solid #e74c3c;
    z-index: 15;
    filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.2));
}

.pointer::after {
    content: '';
    position: absolute;
    top: calc(100% - 6px);
    left: 50%;
    transform: translateX(-50%);
    width: 18px;
    height: 18px;
    background-color: #ffffff;
    border: 4px solid #c0392b;
    border-radius: 50%;
}

/* 控制按钮样式 */
.controls {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.btn {
    padding: 12px 24px;
    font-size: 1.1rem;
    font-weight: bold;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.spin-btn {
    background-color: #27ae60;
    color: white;
    box-shadow: 0 4px 0 #219a52;
}

.spin-btn:hover:not(:disabled) {
    background-color: #2ecc71;
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #27ae60;
}

.stop-btn {
    background-color: #e74c3c;
    color: white;
    box-shadow: 0 4px 0 #c0392b;
}

.stop-btn:hover:not(:disabled) {
    background-color: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #a93226;
}

.btn:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 结果弹窗样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 100;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: modalAppear 0.3s ease-out;
    max-width: 350px;
    width: 90%;
}

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

.modal-content h2 {
    color: #ff6b6b;
    margin-bottom: 20px;
    font-size: 1.8rem;
}

.result-image img {
    width: 100px;
    height: 100px;
    margin-bottom: 20px;
    object-fit: contain;
}

.result-text {
    font-size: 1.4rem;
    font-weight: bold;
    color: #34495e;
    margin-bottom: 30px;
}

.close-btn {
    background-color: #3498db;
    color: white;
    box-shadow: 0 4px 0 #2980b9;
}

.close-btn:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #1f6dad;
}

/* 响应式设计 */
@media (max-width: 480px) {
    h1 {
        font-size: 2rem;
    }

    .wheel-container {
        width: 250px;
        height: 250px;
    }

    .wheel {
        border-width: 10px;
        --prize-distance: 110px;
    }

    .prize img {
        width: 48px;
        height: 48px;
    }

    .prize span {
        font-size: 0.9rem;
    }

    .btn {
        padding: 10px 20px;
        font-size: 1rem;
    }
}