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

body {
    font-family: 'Faustina', serif;
    background: #1a1a1a;
    color: #e0e0e0;
    padding: 0;
    overflow-x: hidden;
}

.editor-container {
    max-width: 1400px;
    margin: 0 auto;
}

h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #4a90e2;
    font-family: 'Faustina', serif;
}

h6 {
    text-align: center;
    margin-top: -25px;
    margin-bottom: 30px;
    color: #ffffff;
    font-family: 'Faustina', serif;
}

.section {
    background: #2a2a2a;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.section-title {
    font-size: 1.3em;
    margin-bottom: 15px;
    color: #4a90e2;
    border-bottom: 2px solid #4a90e2;
    padding-bottom: 5px;
    font-family: 'Faustina', serif;
}

.section-header {
    width: 100%;
    background: #3a3a3a;
    border: none;
    padding: 15px;
    text-align: left;
    cursor: pointer;
    border-radius: 6px;
    font-size: 1.1em;
    color: #4a90e2;
    transition: background 0.2s;
    font-family: 'Faustina', serif;
}

.section-header:hover {
    background: #454545;
}

.section-header:after {
    content: '\002B';
    float: right;
    font-weight: bold;
}

.section-header.active:after {
    content: "\2212";
}

.section-content {
    padding-top: 15px;
}

.subsection {
    background: #333;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 15px;
}

.subsection:last-child {
    margin-bottom: 0;
}

.subsection h3 {
    color: #6badff;
    margin-bottom: 10px;
    font-size: 1.1em;
    font-family: 'Faustina', serif;
}

.form-group {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-group label {
    min-width: 150px;
    font-size: 0.9em;
    font-family: 'Faustina', serif;
}

input[type="text"],
input[type="number"],
input[type="color"],
textarea,
select {
    background: #3a3a3a;
    border: 1px solid #555;
    color: #e0e0e0;
    padding: 6px 10px;
    border-radius: 4px;
    flex: 1;
    font-family: 'Faustina', serif;
}

input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

button {
    background: #4a90e2;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background 0.2s;
    font-family: 'Faustina', serif;
}

button:hover {
    background: #357abd;
}

button.danger {
    background: #e74c3c;
}

button.danger:hover {
    background: #c0392b;
}

button.success {
    background: #27ae60;
}

button.success:hover {
    background: #229954;
}

.character-item, .scene-item {
    background: #3a3a3a;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 6px;
    border: 1px solid #555;
}

.character-header, .scene-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-family: 'Faustina', serif;
}

.scene-content {
    margin-top: 15px;
}

.scene-group {
    background: #333;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 6px;
}

.scene-group h4 {
    color: #6badff;
    margin-bottom: 10px;
    font-size: 0.95em;
    font-family: 'Faustina', serif;
}

.null-checkbox {
    cursor: pointer;
    margin-right: 5px;
}

.null-checkbox[title]:hover {
    opacity: 0.8;
}

.file-input-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.file-name {
    font-size: 0.85em;
    color: #888;
    margin-left: 10px;
    font-family: 'Faustina', serif;
}

.preview-container {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.image-preview {
    max-width: 150px;
    max-height: 100px;
    border: 1px solid #555;
    border-radius: 4px;
}

.sound-preview {
    display: flex;
    align-items: center;
    gap: 10px;
}

.play-button {
    background: #27ae60;
    padding: 6px 12px;
    font-size: 0.85em;
    font-family: 'Faustina', serif;
}

.play-button:hover {
    background: #229954;
}

.action-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 30px;
}

.action-buttons button {
    padding: 12px 30px;
    font-size: 1.1em;
    font-family: 'Faustina', serif;
}

#outputCode {
width: 100%;
min-height: 400px;
font-family: 'Faustina', serif;
font-size: 0.85em;
background: #1a1a1a;
resize: vertical;
}

.collapsible {
    background: #3a3a3a;
    border: none;
    padding: 10px;
    width: 100%;
    text-align: left;
    cursor: pointer;
    border-radius: 4px;
    margin-bottom: 5px;
    font-family: 'Faustina', serif;
}

.collapsible:after {
    content: '\002B';
    float: right;
    font-weight: bold;
}

.collapsible.active:after {
    content: "\2212";
}

.collapsible-content {
    display: none;
    padding: 10px;
    background: #2a2a2a;
    border-radius: 4px;
    margin-bottom: 10px;
}

.preview-text {
    font-size: 0.85em;
    color: #888;
    margin-left: 10px;
    font-family: 'Faustina', serif;
}

.add-character {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.add-character input[type="text"] {
    flex: 1;
}

.scene-item-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
}

.scene-item-header .collapsible {
    flex: 1;
    margin-bottom: 0;
}

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

.scene-action-buttons button {
    padding: 6px 10px;
    font-size: 0.85em;
}

.play-button.stop-button {
    background: #e74c3c;
}

.play-button.stop-button:hover {
    background: #c0392b;
}

.editor-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    display: none;
    overflow-y: auto;
}

.editor-overlay.active {
    display: block;
}

.editor-trigger {
    position: fixed;
    top: 20px;
    left: -60px;
    width: 80px;
    height: 40px;
    background: #4a90e2;
    color: white;
    border: none;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    transition: left 0.3s ease;
    z-index: 999;
    font-family: 'Faustina', serif;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-left: 20px;
}

.editor-trigger:hover {
    left: 0;
}

.editor-trigger::after {
    content: '▶';
    margin-left: 5px;
}

.editor-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    display: none;
    overflow-y: auto;
}

.editor-overlay.active {
    display: block;
}

.overlay-close {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #e74c3c;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    z-index: 1001;
    font-size: 1.1em;
    font-family: 'Faustina', serif;
}

.overlay-close:hover {
    background: #c0392b;
}

.save-button {
    position: fixed;
    top: 20px;
    right: 120px;
    background: #27ae60;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    z-index: 1001;
    font-size: 1.1em;
    font-family: 'Faustina', serif;
}

.save-button:hover {
    background: #229954;
}

.editor-overlay .editor-container {
    padding-top: 60px;
}

.spa-mode .save-load-section,
.spa-mode .generated-code-section {
    display: none;
}

.download-sequence {
    background: #444444;
    padding: 8px 16px;
    font-size: 0.5em;
    margin-left: 10px;
    font-family: 'Faustina', serif;
}

.download-sequence:hover {
    background: #229954;
}

.interaction-blocker {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 900;
    display: none;
}

.interaction-blocker.active {
    display: block;
}
