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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

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

h1 {
    text-align: center;
    color: #667eea;
    margin-bottom: 30px;
    font-size: 2.5em;
    font-weight: 700;
}

.canvas-section {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

.canvas-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.canvas-wrapper label {
    font-weight: 600;
    color: #555;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 1px;
}

canvas {
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    background: white;
    transition: transform 0.2s, box-shadow 0.2s;
    display: block;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

canvas:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.controls-section {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.control-group:last-child {
    margin-bottom: 0;
}

.control-group label {
    font-weight: 600;
    color: #667eea;
    min-width: 100px;
    font-size: 1.1em;
}

.control-group input[type="range"] {
    flex: 1;
    height: 8px;
    border-radius: 5px;
    background: #e0e0e0;
    outline: none;
    -webkit-appearance: none;
}

.control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: background 0.2s;
}

.control-group input[type="range"]::-webkit-slider-thumb:hover {
    background: #5568d3;
}

.control-group input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.control-group input[type="number"] {
    width: 80px;
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    text-align: center;
    transition: border-color 0.2s;
}

.control-group input[type="number"]:focus {
    outline: none;
    border-color: #667eea;
}

.control-group .help-text {
    color: #666;
    font-size: 0.9em;
    font-style: italic;
    margin-left: auto;
    max-width: 400px;
}

.documentation-section {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 30px;
    margin-top: 30px;
}

.documentation-section h2 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.8em;
}

.documentation-section p {
    line-height: 1.8;
    margin-bottom: 15px;
    color: #444;
    font-size: 1.05em;
}

.documentation-section .math-formula {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin: 15px 0;
    border-left: 4px solid #667eea;
    overflow-x: auto;
}

.documentation-section code {
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: #d63384;
}

@media (max-width: 768px) {
    .canvas-section {
        flex-direction: column;
        align-items: center;
    }
    
    .control-group {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .control-group label {
        min-width: auto;
    }
    
    .control-group input[type="range"] {
        width: 100%;
    }
    
    .control-group .help-text {
        margin-left: 0;
        max-width: 100%;
    }
    
    h1 {
        font-size: 2em;
    }
    
    canvas {
        max-width: 100%;
        height: auto;
        width: 100%;
    }
}

