* {
    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;
    color: #333;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 40px;
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

header h1 {
    font-size: 2.5em;
    color: #764ba2;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

header p {
    font-size: 1.1em;
    color: #666;
}

main {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    align-items: start;
}

.configuracion-section {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    margin-bottom: 30px;
    grid-column: 1 / -1;
}

.configuracion-section h2 {
    color: #333;
    margin-bottom: 25px;
    font-size: 1.5em;
    text-align: center;
}

.config-item {
    margin-bottom: 20px;
}

.config-item label {
    display: block;
    font-weight: bold;
    color: #555;
    margin-bottom: 8px;
    font-size: 1.1em;
}

.config-item input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s ease;
}

.config-item input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.config-item small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 0.9em;
}

.btn-iniciar {
    width: 100%;
    padding: 15px 30px;
    font-size: 1.2em;
    font-weight: bold;
    color: white;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    margin-top: 10px;
}

.btn-iniciar:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.btn-iniciar:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.sorteo-section {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.paso {
    margin-bottom: 30px;
    padding: 25px;
    border: 2px solid #e0e0e0;
    border-radius: 15px;
    transition: all 0.3s ease;
}

.paso.actual {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    transform: scale(1.02);
}

.paso h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.5em;
}

.resultado {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    min-height: 80px;
}

.label {
    font-size: 1.2em;
    font-weight: bold;
    color: #555;
    margin-right: 15px;
}

.valor {
    font-size: 2em;
    font-weight: bold;
    color: #667eea;
    background: white;
    padding: 10px 20px;
    border-radius: 10px;
    min-width: 100px;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.valor.animando {
    animation: pulse 0.1s infinite;
}

.valor.resultado-destacado {
    animation: highlight 0.5s ease;
    color: #28a745;
    border: 2px solid #28a745;
}

.btn-sorteo {
    width: 100%;
    padding: 15px 30px;
    font-size: 1.2em;
    font-weight: bold;
    color: white;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn-sorteo:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.btn-sorteo:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.resultado-final {
    margin-top: 30px;
    padding: 30px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border-radius: 15px;
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
}

.resultado-final.mostrar {
    animation: slideIn 0.5s ease forwards;
}

.resultado-final h2 {
    margin-bottom: 20px;
    font-size: 1.8em;
}

.ganador {
    margin: 20px 0;
}

.valor-final {
    font-size: 2.5em;
    font-weight: bold;
    background: rgba(255, 255, 255, 0.2);
    padding: 15px 30px;
    border-radius: 10px;
    display: inline-block;
    margin-top: 10px;
}

.btn-reiniciar {
    margin-top: 20px;
    padding: 12px 25px;
    font-size: 1.1em;
    font-weight: bold;
    color: #28a745;
    background: white;
    border: 2px solid #28a745;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-reiniciar:hover {
    background: #28a745;
    color: white;
    transform: translateY(-2px);
}

.historial {
    background: rgba(255, 255, 255, 0.95);
    padding: 25px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    max-height: 600px;
    overflow-y: auto;
}

.historial h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.3em;
    text-align: center;
}

.lista-historial {
    max-height: 500px;
    overflow-y: auto;
}

.sin-historial {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 20px;
}

.historial-item {
    background: #f8f9fa;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 10px;
    border-left: 4px solid #667eea;
    animation: slideInLeft 0.3s ease;
}

.historial-resultado {
    font-size: 1.3em;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 5px;
}

.historial-fecha {
    font-size: 0.9em;
    color: #666;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes highlight {
    0% { 
        transform: scale(1);
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    }
    50% { 
        transform: scale(1.1);
        box-shadow: 0 8px 20px rgba(40, 167, 69, 0.4);
    }
    100% { 
        transform: scale(1);
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    }
}

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

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@media (max-width: 768px) {
    main {
        grid-template-columns: 1fr;
    }
    
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2em;
    }
    
    .valor {
        font-size: 1.5em;
    }
    
    .valor-final {
        font-size: 2em;
    }
    
    .configuracion-section {
        padding: 20px;
    }
    
    .config-item input {
        padding: 10px 12px;
    }
}
