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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

header {
    background: rgba(255, 255, 255, 0.95);
    padding: 1rem 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    color: #667eea;
    font-size: 1.8rem;
}

.menu-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 0.7rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.menu-btn:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.container {
    display: flex;
    max-width: 1600px;
    margin: 2rem auto;
    padding: 0 1rem;
    gap: 2rem;
}

.wheel-section {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.wheel-container {
    position: relative;
    width: 100%;
    max-width: 600px;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

#wheelCanvas {
    width: 100%;
    height: 100%;
    cursor: pointer;
    filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.3));
    transition: transform 0.1s ease;
}

#wheelCanvas:hover {
    transform: scale(1.02);
}

.arrow-container {
    position: absolute;
    right: -40px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
}

.arrow {
    display: block;
    filter: drop-shadow(-2px -2px 3px rgba(255, 255, 255, 0.8))
            drop-shadow(2px 2px 3px rgba(0, 0, 0, 0.6))
            drop-shadow(1px 1px 2px rgba(0, 0, 0, 0.4))
            drop-shadow(0 6px 12px rgba(0, 0, 0, 0.5));
    transition: all 0.3s ease;
}

.arrow path {
    transition: fill 0.3s ease;
}

.spin-instruction {
    margin-top: 1.5rem;
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.controls-section {
    flex: 0 0 320px;
    max-width: 320px;
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    max-height: 600px;
}

.controls-header {
    margin-bottom: 0.5rem;
}

.controls-header h2 {
    color: #667eea;
    font-size: 1.4rem;
    margin: 0;
}

.control-buttons {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.icon-btn {
    background: #667eea;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    background: #5568d3;
    transform: scale(1.1);
}

#namesList {
    flex: 1;
    width: 100%;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 1rem;
    font-size: 1rem;
    resize: none;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

#namesList:focus {
    outline: none;
    border-color: #667eea;
}

.add-button-container {
    margin-top: 1rem;
}

.update-btn {
    width: 100%;
    background: #10b981;
    color: white;
    border: none;
    padding: 0.8rem;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: all 0.3s ease;
}

.update-btn:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 2rem;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
    position: relative;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.winner-modal-content {
    overflow: hidden;
}

.fireworks-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.firework {
    position: absolute;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    animation: firework 1s ease-out infinite;
}

.firework:nth-child(1) {
    top: 20%;
    left: 20%;
    animation-delay: 0s;
    background: #ff0080;
}

.firework:nth-child(2) {
    top: 30%;
    right: 20%;
    animation-delay: 0.2s;
    background: #00ff80;
}

.firework:nth-child(3) {
    bottom: 30%;
    left: 30%;
    animation-delay: 0.4s;
    background: #0080ff;
}

.firework:nth-child(4) {
    bottom: 20%;
    right: 30%;
    animation-delay: 0.6s;
    background: #ffff00;
}

.firework:nth-child(5) {
    top: 50%;
    left: 50%;
    animation-delay: 0.8s;
    background: #ff00ff;
}

@keyframes firework {
    0% {
        transform: scale(1);
        opacity: 1;
        box-shadow: 0 0 10px currentColor, 0 0 20px currentColor, 0 0 30px currentColor;
    }
    50% {
        transform: scale(20);
        opacity: 0.5;
    }
    100% {
        transform: scale(1);
        opacity: 0;
    }
}

.winner-display {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 2rem 1rem;
}

.winner-display h2 {
    color: #667eea;
    margin-bottom: 1.5rem;
    font-size: 2rem;
}

.winner-name {
    padding: 2rem;
    border-radius: 15px;
    font-size: 2rem;
    font-weight: bold;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    animation: winnerPulse 0.5s ease;
}

@keyframes winnerPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.modal-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    position: relative;
    z-index: 1;
}

.modal-btn {
    flex: 1;
    padding: 0.8rem;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: all 0.3s ease;
}

.close-btn {
    background: #6b7280;
    color: white;
}

.close-btn:hover {
    background: #4b5563;
    transform: translateY(-2px);
}

.remove-btn {
    background: #ef4444;
    color: white;
}

.remove-btn:hover {
    background: #dc2626;
    transform: translateY(-2px);
}

.copy-btn {
    background: #3b82f6;
    color: white;
}

.copy-btn:hover {
    background: #2563eb;
    transform: translateY(-2px);
}

.clear-btn {
    background: #f59e0b;
    color: white;
}

.clear-btn:hover {
    background: #d97706;
    transform: translateY(-2px);
}

.winners-list-content {
    max-height: 300px;
    overflow-y: auto;
    margin: 1.5rem 0;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 10px;
}

.winner-item {
    padding: 0.8rem;
    margin-bottom: 0.5rem;
    border-radius: 8px;
    color: white;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.winner-item i {
    color: rgba(255, 255, 255, 0.8);
}

.empty-winners {
    text-align: center;
    color: #9ca3af;
    padding: 2rem;
    font-style: italic;
}

/* Copy Notification */
.copy-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #10b981;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 2000;
    display: none;
    align-items: center;
    gap: 0.5rem;
    font-weight: bold;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.copy-notification.show {
    display: flex;
}

/* Responsive Design */
@media (max-width: 968px) {
    .container {
        flex-direction: column;
        align-items: center;
    }

    .wheel-section {
        width: 100%;
        max-width: 600px;
        order: 1;
        flex: none;
    }

    .controls-section {
        width: 100%;
        max-width: 600px;
        order: 2;
        max-height: none;
        min-height: 400px;
    }

    #namesList {
        min-height: 200px;
    }

    header h1 {
        font-size: 1.3rem;
    }

    .menu-btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    header {
        padding: 0.8rem 1rem;
    }

    header h1 {
        font-size: 1.1rem;
    }

    .menu-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }

    .modal-content {
        width: 95%;
        padding: 1.5rem;
    }

    .winner-name {
        font-size: 1.5rem;
        padding: 1.5rem;
    }

    .arrow-container {
        right: -30px;
    }

    .arrow {
        width: 45px;
        height: 45px;
    }
}
