:root {
    --primary-color: #4a90e2;
    --primary-hover: #357abd;
    --bg-color: #f5f7fa;
    --text-color: #333;
    --border-color: #ccc;
    --white: #ffffff;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    padding: 20px;
}

.container {
    max-width: 1000px;
    width: 100%;
    background-color: var(--white);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

header {
    text-align: center;
    margin-bottom: 30px;
}

main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

@media (max-width: 768px) {
    main {
        grid-template-columns: 1fr;
    }
}

.input-section {
    display: flex;
    flex-direction: column;
}

label {
    margin-bottom: 10px;
    font-weight: bold;
}

textarea {
    height: 300px;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    resize: none;
    font-size: 16px;
    margin-bottom: 15px;
}

.controls {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

button {
    flex: 1;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 16px;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
}

button svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

button:active {
    transform: scale(0.95);
}

#update-btn {
    background-color: #e0e0e0;
    color: #333;
}

#update-btn:hover {
    background-color: #d0d0d0;
}

#save-btn {
    background-color: #62d292;
    color: white;
}

#save-btn:hover {
    background-color: #4eb97d;
}

#clear-btn {
    background-color: #fb7268;
    color: white;
}

#clear-btn:hover {
    background-color: #e65b50;
}

.primary-btn {
    background-color: var(--primary-color);
    color: white;
    flex: 2; /* Make the spin button wider */
}

.primary-btn:hover {
    background-color: var(--primary-hover);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

#item-count {
    margin-top: 10px;
    font-size: 14px;
    color: #666;
}

.spinner-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.wheel-container {
    position: relative;
    width: 100%;
    max-width: 500px;
    aspect-ratio: 1 / 1;
}

#wheel-canvas {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    box-shadow: 0 0 15px rgba(0,0,0,0.1);
}

#pointer {
    position: absolute;
    top: 50%;
    right: -20px;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background-color: #333;
    clip-path: polygon(0% 50%, 100% 0, 100% 100%);
    z-index: 10;
}

#result-display {
    margin-top: 20px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

#winner-text {
    color: var(--primary-color);
    font-size: 24px;
}

/* Animation Class */
.spinning {
    transition: transform 4s cubic-bezier(0.15, 0, 0.15, 1);
}

.options {
    margin-top: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.options input {
    cursor: pointer;
}