:root {
    --bg-color: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: rgba(148, 163, 184, 0.1);
    --glow: 0 0 20px rgba(99, 102, 241, 0.3);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    background-image: radial-gradient(circle at 50% 0%, #1e293b 0%, #0f172a 100%);
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
}

header {
    text-align: center;
    margin-bottom: 3rem;
}

header h1 {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(to right, #818cf8, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.main-layout {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 4rem;
    align-items: start;
}

/* Wheel Section */
.wheel-container {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    max-width: 600px;
    margin: 0 auto;
    filter: drop-shadow(0 0 50px rgba(99, 102, 241, 0.1));
}

#wheelCanvas {
    width: 100%;
    height: 100%;
    transform-origin: center;
}

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

/* Controls Section */
.controls-container {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.input-group {
    margin-bottom: 2rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

textarea {
    width: 100%;
    height: 300px;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    resize: none;
    transition: var(--transition);
}

textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

button {
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    font-family: 'Inter', sans-serif;
}

.primary-btn {
    background: var(--primary);
    color: white;
    box-shadow: var(--glow);
}

.primary-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background: #1e293b;
    padding: 3rem;
    border-radius: 24px;
    text-align: center;
    border: 1px solid var(--border);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: scale(1);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-width: 90%;
    width: 400px;
}

.modal.hidden .modal-content {
    transform: scale(0.9);
}

.modal h2 {
    color: var(--text-muted);
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.winner-text {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 2rem;
    background: linear-gradient(to right, #818cf8, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.2;
}

/* Responsive */
@media (max-width: 900px) {
    .main-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .controls-container {
        width: 100%;
    }

    header h1 {
        font-size: 2.5rem;
    }
}
