* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #3b09aa; /* 图片中整体大背景偏紫蓝 */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: white;
    overflow: hidden;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.app-container {
    width: 100%;
    max-width: 500px;
    height: 100%;
    position: relative;
    background: #4614c2; /* 稍亮的紫蓝背景 */
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 20px;
}

/* 头部样式 */
.header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 15px;
    position: relative;
    z-index: 10;
}

.header-btn {
    background-color: rgba(255, 255, 255, 0.3);
    padding: 8px 15px;
    border-radius: 4px;
    font-size: 14px;
    color: white;
}

/* 射线背景效果 */
.rays {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200%;
    height: 200%;
    background: repeating-conic-gradient(
        from 0deg,
        transparent 0 15deg,
        rgba(255, 255, 255, 0.05) 15deg 30deg
    );
    transform: translate(-50%, -50%);
    z-index: 1;
    pointer-events: none;
    animation: rotateBackground 60s linear infinite;
}

@keyframes rotateBackground {
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* 转盘外层容器 */
.wheel-container {
    margin-top: 80px;
    position: relative;
    width: 360px;
    height: 360px;
    z-index: 10;
}

.wheel-outer {
    width: 100%;
    height: 100%;
    background-color: #555bf0; /* 转盘外圈蓝色 */
    border-radius: 50%;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4), inset 0 0 10px rgba(0,0,0,0.3);
    border: 4px solid #32107b;
}

/* 装饰灯 */
.lights-container {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

.light {
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    margin: -6px 0 0 -6px;
    box-shadow: inset 0 0 4px rgba(0,0,0,0.3);
}

.light.yellow { 
    background-color: #ffeb3b; 
    box-shadow: 0 0 8px #ffeb3b, inset 0 0 4px rgba(0,0,0,0.1); 
}

.light.cyan { 
    background-color: #00e5ff; 
    box-shadow: 0 0 8px #00e5ff, inset 0 0 4px rgba(0,0,0,0.1); 
}

/* 转盘内层 */
.wheel-inner {
    width: 300px;
    height: 300px;
    background-color: white;
    border-radius: 50%;
    position: absolute;
    border: 4px solid #b3b6fa;
    overflow: hidden;
    /* transition在js中动态设置 */
}

/* 绘制扇形分隔线 */
.wheel-inner::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    /* 5个扇区，每个72度，绘制边界线。通过from 36deg起笔，正好使0度（最上方）位于第一个扇区正中。 */
    background: conic-gradient(
        from 36deg,
        #8288f5 0 0.5deg,
        transparent 0.5deg 71.5deg,
        #8288f5 71.5deg 72.5deg,
        transparent 72.5deg 143.5deg,
        #8288f5 143.5deg 144.5deg,
        transparent 144.5deg 215.5deg,
        #8288f5 215.5deg 216.5deg,
        transparent 216.5deg 287.5deg,
        #8288f5 287.5deg 288.5deg,
        transparent 288.5deg 359.5deg,
        #8288f5 359.5deg 360deg
    );
    border-radius: 50%;
    z-index: 1;
}

/* 奖品文字容器 */
.prize-item {
    position: absolute;
    width: 40px;
    height: 150px; /* 内圆半径 */
    left: calc(50% - 20px);
    bottom: 50%;
    transform-origin: bottom center;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding-top: 15px; /* 距离边缘距离 */
    font-size: 18px;
    font-weight: bold;
    color: #4a192c; /* 深褐色文字 */
    z-index: 2;
}

.prize-item span {
    display: inline-block;
    margin-bottom: 2px;
}

/* 中心GO按钮与指针容器 */
.wheel-btn-wrapper {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 15;
    cursor: pointer;
    transition: transform 0.1s;
}

.wheel-btn-wrapper:active {
    transform: translate(-50%, -50%) scale(0.95);
}

.wheel-btn {
    width: 90px;
    height: 90px;
    background: radial-gradient(circle, #7d50ec 0%, #4625b5 100%);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 34px;
    font-weight: 900;
    color: white;
    box-shadow: 0 5px 15px rgba(0,0,0,0.4);
    border: 6px solid #dcd7fa; /* 淡紫色边框 */
    position: relative;
    z-index: 2;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.6);
}

.wheel-pointer {
    position: absolute;
    top: -24px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 16px solid transparent;
    border-right: 16px solid transparent;
    border-bottom: 32px solid #dcd7fa; /* 颜色和按钮边框一致 */
    z-index: 1;
    filter: drop-shadow(0 -3px 4px rgba(0,0,0,0.3));
}

/* 底部按钮 */
.action-container {
    margin-top: 60px;
    z-index: 10;
}

.start-btn {
    background: linear-gradient(180deg, #ffc107, #ff9800);
    border: none;
    padding: 15px 40px;
    border-radius: 30px;
    color: #6a1b9a;
    font-size: 22px;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 6px 15px rgba(0,0,0,0.4), inset 0 -3px 5px rgba(0,0,0,0.2);
    border: 3px solid #ffeb3b;
    transition: transform 0.1s, box-shadow 0.1s;
    text-shadow: 1px 1px 1px rgba(255,255,255,0.8);
}

.start-btn:active {
    transform: translateY(3px);
    box-shadow: 0 3px 8px rgba(0,0,0,0.4), inset 0 -1px 3px rgba(0,0,0,0.2);
}

/* 装饰元素 */
.decorations {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 20; /* 提高层级，避免被转盘遮挡 */
}

.deco {
    position: absolute;
    font-size: 45px;
    filter: drop-shadow(0 5px 5px rgba(0,0,0,0.3));
    animation: float 4s ease-in-out infinite alternate;
}

/* 调整红包位置，使其更靠中间一点，避免被屏幕边缘或转盘遮挡 */
.env1 { top: 8%; left: 15%; transform: rotate(-15deg); }
.env2 { top: 12%; right: 15%; transform: rotate(20deg); animation-delay: 1s; }
.coin1 { bottom: 20%; left: 10%; transform: rotate(-10deg); font-size: 55px; animation-delay: 0.5s; }
.coin2 { bottom: 15%; right: 10%; transform: rotate(25deg); font-size: 55px; animation-delay: 1.5s; }

@keyframes float {
    0% { transform: translateY(0) rotate(var(--rotation, 0deg)); }
}

/* 弹窗样式 */
.modal-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: linear-gradient(135deg, #7d50ec, #4625b5);
    border-radius: 16px;
    padding: 30px 40px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    border: 3px solid #dcd7fa;
    transform: translateY(-50px) scale(0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    min-width: 250px;
}

.modal-overlay.active .modal-content {
    transform: translateY(0) scale(1);
}

.modal-header {
    font-size: 24px;
    font-weight: bold;
    color: #ffeb3b;
    margin-bottom: 15px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.modal-body {
    font-size: 20px;
    margin-bottom: 25px;
    color: white;
}

.modal-btn {
    background: linear-gradient(180deg, #b06ab3, #6a45dc);
    border: 2px solid #e0c3fc;
    color: white;
    padding: 10px 30px;
    border-radius: 20px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    transition: transform 0.1s, box-shadow 0.1s;
}

.modal-btn:active {
    transform: scale(0.95);
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}
