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

body {
    font-family: 'Space Mono', monospace;
    background: #0a0a0a;
    color: #e0e0e0;
    line-height: 1.6;
    min-height: 100vh;
}

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

header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem 0;
    border-bottom: 2px solid #333;
}

h1 {
    font-size: 3rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0.5rem;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

.subtitle {
    font-size: 1.1rem;
    color: #888;
    font-weight: 400;
}

.input-section {
    background: #1a1a1a;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid #333;
}

.input-tabs {
    display: flex;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #333;
}

.tab-btn {
    background: none;
    border: none;
    color: #888;
    font-family: inherit;
    font-size: 1rem;
    padding: 1rem 1.5rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.tab-btn.active {
    color: #ffffff;
    border-bottom-color: #ffffff;
}

.tab-btn:hover {
    color: #cccccc;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

#conceptInput {
    width: 100%;
    min-height: 120px;
    background: #0f0f0f;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 1rem;
    color: #e0e0e0;
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
    transition: border-color 0.3s ease;
}

#conceptInput:focus {
    outline: none;
    border-color: #666;
}

.image-upload-area {
    border: 2px dashed #444;
    border-radius: 8px;
    padding: 3rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-upload-area:hover {
    border-color: #666;
    background: rgba(255, 255, 255, 0.02);
}

.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.upload-icon {
    font-size: 3rem;
    opacity: 0.6;
}

.upload-hint {
    font-size: 0.9rem;
    color: #666;
}

.uploaded-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.uploaded-image {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
}

.uploaded-image img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
}

.remove-image {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background: #ff4444;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.generate-btn {
    width: 100%;
    background: #ffffff;
    color: #000000;
    border: none;
    border-radius: 8px;
    padding: 1rem 2rem;
    font-family: inherit;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1.5rem;
    position: relative;
    overflow: hidden;
}

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

.generate-btn:disabled {
    background: #444;
    color: #888;
    cursor: not-allowed;
    transform: none;
}

.btn-loader {
    width: 20px;
    height: 20px;
    border: 2px solid #000;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.output-section {
    background: #1a1a1a;
    border-radius: 12px;
    padding: 2rem;
    border: 1px solid #333;
    animation: fadeIn 0.5s ease-in;
}

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

.level-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #333;
    flex-wrap: wrap;
    gap: 1rem;
}

#levelTitle {
    font-size: 2rem;
    color: #ffffff;
}

.threat-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 700;
}

.threat-badge.safe {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
    border: 1px solid #22c55e;
}

.threat-badge.moderate {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
    border: 1px solid #fbbf24;
}

.threat-badge.dangerous {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid #ef4444;
}

.threat-badge.extreme {
    background: rgba(147, 51, 234, 0.2);
    color: #9333ea;
    border: 1px solid #9333ea;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.info-card {
    background: #0f0f0f;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 1.5rem;
}

.info-card.full-width {
    grid-column: 1 / -1;
}

.info-card h3 {
    color: #ffffff;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.classification-details {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #222;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    color: #888;
    font-weight: 400;
}

.detail-value {
    color: #ffffff;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.9rem;
}

.access-section h4 {
    color: #cccccc;
    margin: 1rem 0 0.5rem 0;
    font-size: 1rem;
}

.access-section h4:first-child {
    margin-top: 0;
}

ul {
    list-style: none;
    padding: 0;
}

li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #222;
    color: #cccccc;
}

li:last-child {
    border-bottom: none;
}

#levelDescription {
    color: #cccccc;
    line-height: 1.8;
    font-size: 1rem;
}

.actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #333;
    justify-content: center;
    flex-wrap: wrap;
}

.action-btn {
    background: #333;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 0.8rem 1.5rem;
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.action-btn:hover {
    background: #444;
    transform: translateY(-2px);
}

.advanced-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #333;
}

.option-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.option-group label {
    color: #cccccc;
    font-weight: 600;
    font-size: 0.9rem;
}

.option-group select,
.option-group textarea {
    background: #0f0f0f;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 0.8rem;
    color: #e0e0e0;
    font-family: inherit;
    font-size: 0.9rem;
    transition: border-color 0.3s ease;
}

.option-group select:focus,
.option-group textarea:focus {
    outline: none;
    border-color: #666;
}

.option-group textarea {
    min-height: 60px;
    resize: vertical;
}

.output-tabs {
    display: flex;
    margin-bottom: 2rem;
    border-bottom: 2px solid #333;
    gap: 0.5rem;
}

.output-tab-btn {
    background: none;
    border: none;
    color: #888;
    font-family: inherit;
    font-size: 1rem;
    padding: 1rem 1.5rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
    border-radius: 8px 8px 0 0;
}

.output-tab-btn.active {
    color: #ffffff;
    background: #0f0f0f;
    border-bottom-color: #ffffff;
}

.output-tab-btn:hover {
    color: #cccccc;
    background: rgba(255, 255, 255, 0.05);
}

.output-tab-content {
    display: none;
}

.output-tab-content.active {
    display: block;
}

.level-document {
    background: #0f0f0f;
    border-radius: 8px;
    padding: 2rem;
    line-height: 1.8;
    font-size: 1rem;
    color: #cccccc;
}

.level-header-doc {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #333;
}

.level-header-doc h1 {
    font-size: 2.5rem;
    color: #ffffff;
    margin-bottom: 0.5rem;
}

.level-subtitle {
    font-style: italic;
    color: #888;
    font-size: 1.1rem;
}

.survival-difficulty {
    margin-bottom: 2rem;
    text-align: center;
}

.survival-difficulty h2 {
    color: #ffffff;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    letter-spacing: 2px;
}

.difficulty-class {
    font-size: 2rem;
    font-weight: 700;
    padding: 1rem 2rem;
    border-radius: 8px;
    display: inline-block;
    min-width: 150px;
}

.difficulty-class.class-0 {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
    border: 2px solid #22c55e;
}

.difficulty-class.class-1 {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
    border: 2px solid #3b82f6;
}

.difficulty-class.class-2 {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
    border: 2px solid #fbbf24;
}

.difficulty-class.class-3 {
    background: rgba(245, 101, 101, 0.2);
    color: #f56565;
    border: 2px solid #f56565;
}

.difficulty-class.class-4 {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 2px solid #ef4444;
}

.difficulty-class.class-5 {
    background: rgba(147, 51, 234, 0.2);
    color: #9333ea;
    border: 2px solid #9333ea;
}

.level-section {
    margin-bottom: 2.5rem;
}

.level-section h2 {
    color: #ffffff;
    font-size: 1.4rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #333;
}

.level-section h3 {
    color: #ffffff;
    font-size: 1.2rem;
    margin: 1.5rem 0 0.8rem 0;
}

.subsections-content h3 {
    color: #ffffff;
    font-size: 1.1rem;
    margin: 1.5rem 0 0.8rem 0;
    padding-top: 1rem;
    border-top: 1px solid #444;
}

.subsections-content h3:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.description-content,
.bases-content,
.entities-content,
.objects-content,
.phenomena-content {
    color: #cccccc;
    line-height: 1.8;
}

.description-content p,
.bases-content p,
.entities-content p,
.objects-content p,
.phenomena-content p {
    margin-bottom: 1.2rem;
}

.access-content ul {
    list-style: disc;
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.access-content li {
    color: #cccccc;
    padding: 0.3rem 0;
    border-bottom: none;
}

.name-input-section {
    margin-bottom: 1.5rem;
}

.name-input-section label {
    color: #cccccc;
    font-weight: 600;
    font-size: 0.9rem;
    display: block;
    margin-bottom: 0.5rem;
}

.name-input-section input {
    width: 100%;
    background: #0f0f0f;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 0.8rem;
    color: #e0e0e0;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.name-input-section input:focus {
    outline: none;
    border-color: #666;
}

.image-caption {
    text-align: center;
    font-style: italic;
    color: #888;
    font-size: 0.9rem;
    margin-top: 0.5rem;
    margin-bottom: 0;
}

.generator-type-selector {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.generator-btn {
    background: #333;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 1rem 2rem;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.generator-btn:hover {
    background: #444;
    transform: translateY(-2px);
}

.generator-btn.active {
    background: #ffffff;
    color: #000000;
}

.switch-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.5rem;
}

.switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.9rem;
    color: #cccccc;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch input:checked + .slider::before {
    transform: translateX(20px);
    background: #ffffff;
}

.switch input:checked + .slider {
    background: #666;
}

.slider {
    position: relative;
    width: 44px;
    height: 24px;
    background: #333;
    border-radius: 24px;
    transition: 0.3s;
    margin-right: 0.5rem;
}

.slider::before {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    left: 2px;
    top: 2px;
    background: #888;
    border-radius: 50%;
    transition: 0.3s;
}

.count-input {
    width: 100px;
    background: #0f0f0f;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 0.5rem;
    color: #e0e0e0;
    font-family: inherit;
    font-size: 0.9rem;
}

.count-input:focus {
    outline: none;
    border-color: #666;
}

.classification-display {
    background: #0f0f0f;
    border-radius: 8px;
    padding: 1.5rem;
    border: 1px solid #333;
}

.classification-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.class-item {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding: 0.8rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    border: 1px solid #444;
}

.class-label {
    color: #888;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.class-value {
    color: #ffffff;
    font-weight: 700;
    font-size: 1rem;
}

.content-image {
    margin: 2rem 0;
    text-align: center;
}

.content-image img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    border: 2px solid #333;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .level-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .actions {
        flex-direction: column;
    }
}