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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 1200px;
    width: 100%;
}

/* Encabezado de la aplicación */
.app-header {
    text-align: center;
    margin-bottom: 30px;
}

h1.app-title {
    color: #333;
    margin-bottom: 10px;
    font-size: 2.5em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.course-subtitle {
    color: #667eea;
    font-size: 1.6em;
    margin-bottom: 15px;
    font-weight: bold;
    letter-spacing: 0.5px;
}

.app-header h4 {
    color: #555;
    font-size: 1.1em;
    font-weight: normal;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.5;
}

.main-content {
    display: flex;
    gap: 30px;
    margin-bottom: 20px;
}

/* Panel de la Ruleta */
.wheel-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.wheel-container {
    position: relative;
    width: 400px;
    height: 400px;
    margin-bottom: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
}

canvas {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.pointer {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-top: 40px solid #ff4757;
    filter: drop-shadow(0 5px 5px rgba(0, 0, 0, 0.3));
    z-index: 10;
}

.button-group {
    display: flex;
    gap: 15px;
    width: 100%;
}

/* Panel de Nombres */
.names-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.input-section {
    margin-bottom: 20px;
}

.input-section h2 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1.3em;
}

textarea {
    width: 100%;
    height: 120px;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 14px;
    resize: vertical;
    transition: border-color 0.3s;
    font-family: 'Arial', sans-serif;
    margin-bottom: 5px;
}

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

/* Modal Input */
.modal-input {
    width: 100%;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
    font-family: 'Arial', sans-serif;
}

.modal-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.2);
}

.input-hint {
    margin-bottom: 10px;
    color: #666;
}

.names-list-container {
    flex: 1;
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
    border: 2px solid #e9ecef;
}

.names-list-container h3 {
    color: #495057;
    margin-bottom: 5px;
    font-size: 1.1em;
}

.names-list-container small {
    display: block;
    color: #6c757d;
    margin-bottom: 15px;
}

.names-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    max-height: 250px;
    overflow-y: auto;
    padding: 5px;
}

.no-names {
    color: #adb5bd;
    font-style: italic;
    text-align: center;
    width: 100%;
    padding: 20px;
}

/* Botones */
button {
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-add {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 100%;
    font-size: 14px;
    padding: 12px;
}

.btn-add:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.4);
}

.btn-spin {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    font-size: 20px;
    padding: 15px 25px;
    flex: 2;
}

.btn-spin:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(245, 87, 108, 0.4);
}

.btn-reset {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    color: #333;
    flex: 1;
}

.btn-reset:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(168, 237, 234, 0.4);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Tags de nombres */
.name-tag {
    background: white;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.name-tag:hover {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.name-tag.used {
    opacity: 0.5;
    text-decoration: line-through;
    background: #f1f3f5;
}

.remove-name {
    cursor: pointer;
    color: #ff4757;
    font-weight: bold;
    font-size: 18px;
    line-height: 1;
    transition: all 0.3s;
    padding: 0 5px;
}

.remove-name:hover {
    color: #ff0000;
    transform: scale(1.3);
}

/* Barra de estado */
.status-bar {
    margin-top: 20px;
}

.status {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.status.spinning {
    color: #f5576c;
    font-weight: bold;
    animation: pulseText 0.5s ease-in-out infinite alternate;
}

@keyframes pulseText {
    from { opacity: 0.6; }
    to { opacity: 1; }
}

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.modal-overlay.show {
    display: flex !important;
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.5s ease-out;
    overflow: hidden;
}

@keyframes modalSlideIn {
    from {
        transform: scale(0.5) translateY(-100px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.modal-header {
    text-align: center;
    margin-bottom: 20px;
}

.modal-header h2 {
    color: #333;
    font-size: 2em;
}

.modal-body {
    text-align: center;
    padding: 20px;
}

.winner-label {
    color: #555;
    font-size: 1.1em;
}

.winner-name {
    font-size: 3em;
    font-weight: bold;
    color: #667eea;
    margin: 20px 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    animation: winnerPulse 0.5s ease-in-out infinite alternate;
}

@keyframes winnerPulse {
    from {
        transform: scale(1);
    }
    to {
        transform: scale(1.05);
    }
}

.modal-footer {
    text-align: center;
    margin-top: 20px;
}

.btn-close-modal {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 40px;
    font-size: 16px;
}

.btn-close-modal:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.4);
}

/* Fuegos artificiales */
.fireworks-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

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

@keyframes fireworkBurst {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(var(--tx), var(--ty)) scale(0);
        opacity: 0;
    }
}

/* Chispitas */
.sparkles {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 2;
}

.sparkle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: gold;
    border-radius: 50%;
    animation: sparkleFloat 1.5s ease-out forwards;
}

@keyframes sparkleFloat {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
    100% {
        transform: translate(var(--sx), var(--sy)) scale(0);
        opacity: 0;
    }
}

/* Responsive */
@media (max-width: 968px) {
    .main-content {
        flex-direction: column;
    }
    
    .wheel-container {
        width: 300px;
        height: 300px;
    }
    
    h1.app-title {
        font-size: 2em;
    }
    
    .winner-name {
        font-size: 2em;
    }
}

@media (max-width: 600px) {
    .container {
        padding: 20px;
    }
    
    h1.app-title {
        font-size: 1.5em;
    }
    
    .wheel-container {
        width: 250px;
        height: 250px;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .modal-content {
        padding: 20px;
    }
    
    .modal-header h2 {
        font-size: 1.5em;
    }
}