* {
    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;
    padding: 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
    animation: fadeIn 0.5s ease;
}

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

h1 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    margin: 0;
    text-align: center;
    font-size: 2em;
}

form {
    padding: 30px;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 10px;
    color: #333;
    font-size: 1.1em;
}

.radio-group {
    display: flex;
    gap: 20px;
}

.radio-group label {
    display: inline-flex;
    align-items: center;
    font-weight: normal;
    cursor: pointer;
}

.radio-group input {
    margin-right: 8px;
}

select, textarea, input[type="color"] {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

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

textarea {
    resize: vertical;
    font-family: monospace;
    font-size: 14px;
}

input[type="range"] {
    width: calc(100% - 60px);
    display: inline-block;
    margin-right: 10px;
}

input[type="range"] + output {
    display: inline-block;
    width: 50px;
    text-align: center;
    font-weight: bold;
    color: #667eea;
}

.preset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 10px;
}

.preset-card {
    cursor: pointer;
    text-align: center;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    transition: all 0.3s;
}

.preset-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.preset-card input {
    display: none;
}

.preset-card input:checked + .preset-preview {
    border-color: #667eea;
    background: #f0f0ff;
}

.preset-preview {
    width: 100%;
    height: 80px;
    margin-bottom: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    transition: all 0.3s;
}

.line-preview {
    background: repeating-linear-gradient(
        transparent,
        transparent 14px,
        #ccc 14px,
        #ccc 15px
    );
}

.line-guide-preview {
    background: repeating-linear-gradient(
        transparent,
        transparent 10px,
        #ddd 10px,
        #ddd 11px,
        transparent 11px,
        transparent 14px,
        #ccc 14px,
        #ccc 15px
    );
}

.cell-preview {
    background-image: 
        linear-gradient(to right, #ddd 1px, transparent 1px),
        linear-gradient(to bottom, #ddd 1px, transparent 1px);
    background-size: 20px 20px;
}

.cell-guide-preview {
    background-image: 
        linear-gradient(to right, #ddd 1px, transparent 1px),
        linear-gradient(to bottom, #ddd 1px, transparent 1px),
        repeating-linear-gradient(45deg, #eee 0px, #eee 1px, transparent 1px, transparent 20px);
    background-size: 20px 20px, 20px 20px, auto;
}

.btn-generate {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s;
}

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

.btn-generate:active {
    transform: translateY(0);
}

.info {
    background: #f8f9fa;
    padding: 20px 30px;
    border-top: 1px solid #e0e0e0;
}

.info h3 {
    color: #667eea;
    margin-bottom: 10px;
}

.info ol {
    margin-left: 20px;
    line-height: 1.8;
}

.note {
    margin-top: 15px;
    padding: 10px;
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    color: #856404;
}

@media (max-width: 768px) {
    .container {
        margin: 10px;
    }
    
    h1 {
        font-size: 1.5em;
        padding: 20px;
    }
    
    form {
        padding: 20px;
    }
    
    .preset-grid {
        grid-template-columns: 1fr;
    }
    
    .radio-group {
        flex-direction: column;
        gap: 10px;
    }
}