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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    padding: 40px;
    max-width: 900px;
    width: 100%;
}

h1 {
    text-align: center;
    color: #1f2937;
    margin-bottom: 30px;
    font-size: 28px;
}

/* 配置区样式 */
.config-section {
    margin-bottom: 40px;
}

.config-section h2 {
    font-size: 20px;
    color: #374151;
    margin-bottom: 20px;
}

.config-items {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.config-item {
    display: flex;
    gap: 20px;
    align-items: center;
    padding: 15px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.config-item label {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.config-item label span:first-child {
    color: #4b5563;
    font-weight: 500;
    min-width: 80px;
}

.config-item input[type="text"],
.config-item input[type="number"] {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.config-item input[type="text"]:focus,
.config-item input[type="number"]:focus {
    outline: none;
    border-color: #3b82f6;
}

.config-item input[type="number"].error {
    border-color: #ef4444;
}

.config-item .unit {
    color: #6b7280;
    font-weight: 500;
}

.validation-message {
    margin-top: 15px;
    padding: 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    min-height: 20px;
}

.validation-message.success {
    color: #10b981;
    background: #d1fae5;
}

.validation-message.error {
    color: #ef4444;
    background: #fee2e2;
}

/* 转盘区样式 */
.wheel-section {
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
}

.wheel-container {
    position: relative;
    width: 400px;
    height: 400px;
}

.wheel {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    position: relative;
    overflow: hidden;
    border: 8px solid #ffffff;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.1s linear;
}

.wheel-sector {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transform-origin: 50% 50%;
    /* Create a wedge centered at top (0 degrees) with 36 degree spread (-18 to +18) */
    /* tan(18) = 0.3249 => 50 * 0.3249 = 16.245 */
    /* Points: Center(50,50), TopLeft(33.755, 0), TopRight(66.245, 0) */
    clip-path: polygon(50% 50%, 33.755% 0%, 66.245% 0%);
}

/* 10个扇形，每个36度 */
.wheel-sector[data-index="0"] { background: #fee2e2; transform: rotate(0deg); }
.wheel-sector[data-index="1"] { background: #dbeafe; transform: rotate(36deg); }
.wheel-sector[data-index="2"] { background: #d1fae5; transform: rotate(72deg); }
.wheel-sector[data-index="3"] { background: #fef3c7; transform: rotate(108deg); }
.wheel-sector[data-index="4"] { background: #ede9fe; transform: rotate(144deg); }
.wheel-sector[data-index="5"] { background: #fee2e2; transform: rotate(180deg); }
.wheel-sector[data-index="6"] { background: #dbeafe; transform: rotate(216deg); }
.wheel-sector[data-index="7"] { background: #d1fae5; transform: rotate(252deg); }
.wheel-sector[data-index="8"] { background: #fef3c7; transform: rotate(288deg); }
.wheel-sector[data-index="9"] { background: #ede9fe; transform: rotate(324deg); }

.sector-text {
    position: absolute;
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    white-space: nowrap;
    pointer-events: none;
    z-index: 5;
    /* Position text at the top of the wedge */
    top: 15%;
    left: 50%;
    transform: translateX(-50%);
    /* Optional: rotate text to be vertical/radial if needed, but horizontal is readable for top sector */
}

.pointer {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translate(-50%, -25%);
    width: 0;
    height: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-top: 40px solid #ef4444;
    z-index: 10;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* 操作区样式 */
.action-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.draw-button {
    padding: 15px 40px;
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    background: #3b82f6;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 200px;
}

.draw-button:hover:not(:disabled) {
    background: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.draw-button:active:not(:disabled) {
    transform: translateY(0);
}

.draw-button:disabled {
    background: #9ca3af;
    color: #ffffff;
    cursor: not-allowed;
    transform: none;
}

.result-display {
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 16px;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
}

.result-display.winner {
    color: #ef4444;
    font-weight: bold;
    font-size: 18px;
    background: #fee2e2;
}

@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

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

    .config-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .config-item label {
        width: 100%;
    }
}

