* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a2e, #16213e, #0f3460);
    color: #fff;
    min-height: 100vh;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 40px;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

header p {
    font-size: 1.1rem;
    opacity: 0.8;
}

.section {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    border: 1px solid rgba(255,255,255,0.2);
}

.hidden {
    display: none;
}

.genre-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.genre-card {
    background: rgba(255,255,255,0.05);
    border: 2px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.genre-card:hover {
    border-color: #ff6b6b;
    background: rgba(255,107,107,0.1);
    transform: translateY(-5px);
}

.genre-card.selected {
    border-color: #ff6b6b;
    background: rgba(255,107,107,0.2);
}

.genre-card h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: #ff6b6b;
}

.genre-card p {
    font-size: 0.9rem;
    opacity: 0.8;
    line-height: 1.4;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #ff6b6b;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    background: rgba(255,255,255,0.9);
    color: #333;
    font-size: 1rem;
}

.form-group select option {
    background: #fff;
    color: #333;
    padding: 8px;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #ff6b6b;
}

.form-group input::placeholder {
    color: rgba(0,0,0,0.5);
}

.btn-generate,
.btn-new {
    background: linear-gradient(45deg, #ff6b6b, #ee5a52);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    margin-top: 20px;
}

.btn-generate:hover,
.btn-new:hover {
    background: linear-gradient(45deg, #ee5a52, #ff6b6b);
    transform: translateY(-2px);
}

.story-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.btn-action {
    background: linear-gradient(45deg, #4ecdc4, #44a08d);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
    min-width: 140px;
}

.btn-action:hover {
    background: linear-gradient(45deg, #44a08d, #4ecdc4);
    transform: translateY(-2px);
}

.btn-copy {
    background: linear-gradient(45deg, #667eea, #764ba2);
}

.btn-copy:hover {
    background: linear-gradient(45deg, #764ba2, #667eea);
}

.btn-export {
    background: linear-gradient(45deg, #f093fb, #f5576c);
}

.btn-export:hover {
    background: linear-gradient(45deg, #f5576c, #f093fb);
}

.btn-new {
    flex: 1 1 100%;
    margin-top: 15px;
}

.loader {
    border: 4px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top: 4px solid #ff6b6b;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#loading {
    text-align: center;
}

.story-content {
    background: rgba(0,0,0,0.3);
    padding: 25px;
    border-radius: 10px;
    border-left: 4px solid #ff6b6b;
    line-height: 1.8;
    font-size: 1.1rem;
    white-space: pre-wrap;
    max-height: 600px;
    overflow-y: auto;
}

.story-content::-webkit-scrollbar {
    width: 8px;
}

.story-content::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
}

.story-content::-webkit-scrollbar-thumb {
    background: #ff6b6b;
    border-radius: 4px;
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    z-index: 1000;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    max-width: 300px;
}

.notification.show {
    transform: translateX(0);
}

.notification-success {
    background: linear-gradient(45deg, #4CAF50, #45a049);
}

.notification-error {
    background: linear-gradient(45deg, #f44336, #da190b);
}

.notification-info {
    background: linear-gradient(45deg, #2196F3, #0b7dda);
}

.footer {
    text-align: center;
    padding: 20px 0;
    margin-top: 40px;
    border-top: 1px solid rgba(255,255,255,0.2);
}

.footer p {
    color: rgba(255,255,255,0.7);
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .genre-grid {
        grid-template-columns: 1fr;
    }
    
    .section {
        padding: 20px;
    }
    
    .story-actions {
        flex-direction: column;
    }
    
    .btn-action {
        min-width: auto;
        margin-bottom: 10px;
    }
    
    .notification {
        right: 15px;
        left: 15px;
        max-width: none;
        transform: translateY(-100px);
    }
    
    .notification.show {
        transform: translateY(0);
    }
}