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

body {
    font-family: 'Noto Sans', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    color: #333;
}

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

.header {
    text-align: center;
    margin-bottom: 30px;
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.logo {
    height: 60px;
    margin-bottom: 10px;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

.header h1 {
    font-size: 2.5em;
    color: #2c3e50;
    margin-bottom: 10px;
    font-weight: 700;
}

.header p {
    color: #7f8c8d;
    font-size: 1.1em;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.creator-panel, .preview-panel {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid #ecf0f1;
}

.section:last-child {
    border-bottom: none;
}

.section h2 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.4em;
}

.input-group {
    margin-bottom: 15px;
}

.input-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #34495e;
}

.input-group input, .input-group select, .input-group textarea {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e6ed;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.input-group input:focus, .input-group select:focus, .input-group textarea:focus {
    outline: none;
    border-color: #3498db;
}

.input-group textarea {
    height: 80px;
    resize: vertical;
}

.character-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
    margin-bottom: 15px;
}

.character-item {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 12px;
    font-weight: 600;
}

.character-item:hover {
    background: #e3f2fd;
    border-color: #2196f3;
}

.character-item.selected {
    background: #4caf50;
    border-color: #4caf50;
    color: white;
}

.selected-list {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 8px;
    min-height: 40px;
    border: 2px dashed #dee2e6;
}

.selected-character {
    display: inline-block;
    background: #4caf50;
    color: white;
    padding: 5px 10px;
    margin: 2px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
}

.feature-toggles {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toggle {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 600;
}

.toggle input {
    margin-right: 8px;
    transform: scale(1.2);
}

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

.generate-btn:hover {
    transform: translateY(-2px);
}

.episode-card {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    min-height: 200px;
}

.preview-placeholder {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

.placeholder-icon {
    font-size: 3em;
    margin-bottom: 10px;
}

.episode-preview {
    animation: fadeIn 0.5s ease;
}

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

.episode-title {
    font-size: 1.5em;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 10px;
}

.episode-number {
    background: #3498db;
    color: white;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 15px;
}

.episode-details {
    margin-bottom: 15px;
}

.episode-details p {
    margin-bottom: 8px;
    color: #555;
}

.episode-details strong {
    color: #2c3e50;
}

.action-buttons {
    display: flex;
    gap: 10px;
}

.action-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.save-btn {
    background: #27ae60;
    color: white;
}

.save-btn:hover:not(:disabled) {
    background: #219a52;
}

.share-btn {
    background: #e74c3c;
    color: white;
}

.share-btn:hover:not(:disabled) {
    background: #c0392b;
}

.random-btn {
    background: #f39c12;
    color: white;
}

.random-btn:hover {
    background: #e67e22;
}

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.saved-episodes {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.saved-episodes h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.4em;
}

.saved-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.saved-episode {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.saved-episode:hover {
    background: #e3f2fd;
    border-color: #2196f3;
}

.empty-message {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    grid-column: 1 / -1;
}

@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .character-grid {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .header h1 {
        font-size: 2em;
    }
}

