:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --accent: #f43f5e;
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg);
    color: var(--text-main);
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.container {
    width: 90%;
    max-width: 1000px;
    padding: 2rem;
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

header p {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.main-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

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

.input-section {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 1.5rem;
    box-shadow: var(--shadow);
    text-align: left;
}

.input-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-main);
}

#name-input {
    width: 100%;
    height: 200px;
    padding: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 0.75rem;
    font-family: inherit;
    font-size: 1rem;
    resize: none;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

#name-input:focus {
    outline: none;
    border-color: var(--primary);
}

.actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.secondary-btn {
    flex: 1;
    padding: 0.6rem 1rem;
    border: 1px solid #e2e8f0;
    background: white;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.secondary-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.wheel-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.wheel-wrapper {
    position: relative;
    width: 500px;
    height: 500px;
}

@media (max-width: 550px) {
    .wheel-wrapper {
        width: 300px;
        height: 300px;
    }
    #wheel-canvas {
        width: 300px;
        height: 300px;
    }
}

.pointer {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    background: var(--accent);
    clip-path: polygon(50% 100%, 0 0, 100% 0);
    z-index: 10;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

#wheel-canvas {
    max-width: 100%;
    height: auto;
    filter: drop-shadow(0 0 10px rgba(0,0,0,0.1));
}

.spin-button {
    padding: 1rem 3rem;
    font-size: 1.5rem;
    font-weight: 800;
    text-transform: uppercase;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 3rem;
    cursor: pointer;
    box-shadow: 0 4px 0 var(--primary-hover);
    transition: all 0.1s;
}

.spin-button:active {
    transform: translateY(4px);
    box-shadow: 0 0 0 var(--primary-hover);
}

.spin-button:disabled {
    background: #cbd5e1;
    box-shadow: 0 4px 0 #94a3b8;
    cursor: not-allowed;
}

/* Modal */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    display: none;
    z-index: 100;
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: white;
    padding: 3rem;
    border-radius: 2rem;
    text-align: center;
    z-index: 101;
    display: none;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal.active {
    display: block;
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.modal-content h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.winner-text {
    font-size: 3rem;
    font-weight: 900;
    color: var(--primary);
    margin-bottom: 2rem;
}

.close-btn {
    padding: 0.75rem 2rem;
    background: var(--text-main);
    color: white;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 600;
}

#modal-overlay.active {
    display: block;
}