body {
    font-family: sans-serif;
    background: #f4f4f4;
    margin: 0;
    color: #222;
}
.top-bar {
    background: #fff;
    padding: 16px 24px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.07);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.top-bar h1 {
    margin: 0;
    font-size: 1.5em;
}
.top-bar .info {
    font-size: 1em;
    color: #666;
}
.main-content-area {
    display: flex;
    gap: 32px;
    padding: 24px;
    justify-content: center;
}
.editor-section, .preview-section {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    padding: 20px;
    min-width: 340px;
}
.editor-section h2, .preview-section h2 {
    margin-top: 0;
    font-size: 1.2em;
    border-bottom: 1px solid #eee;
    padding-bottom: 6px;
}
.grid-2x2-container {
    display: grid;
    grid-template-columns: repeat(2, 200px);
    grid-template-rows: repeat(2, 200px);
    gap: 12px;
    margin-bottom: 16px;
}
.node-grid-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.grid-container {
    display: grid;
    grid-template-columns: repeat(16, 1fr);
    grid-template-rows: repeat(16, 1fr);
    width: 200px;
    height: 200px;
    border: 1px solid #bbb;
    background: #fafafa;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.grid-cell {
    border: 1px solid #eee;
    background: #fff;
    transition: background 0.1s;
}
.grid-cell.on {
    background: #222;
}
.grid-cell.preview {
    background: #2196f3 !important;
    opacity: 0.5;
}
.grid-cell:hover {
    background: #e3f2fd;
    cursor: pointer;
}
.frame-controls, .animation-controls {
    margin-top: 10px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.timeline-section {
    background: #fff;
    margin: 24px;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    padding: 16px;
}
#frame-thumbnails-container {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}
.thumbnail-item {
    border: 2px solid transparent;
    border-radius: 4px;
    background: #f7f7f7;
    padding: 2px;
    cursor: pointer;
    transition: border-color 0.2s;
}
.thumbnail-item.active {
    border-color: #007bff;
}
.thumbnail-preview {
    display: grid;
    grid-template-columns: repeat(16, 1fr);
    grid-template-rows: repeat(16, 1fr);
    width: 32px;
    height: 32px;
    border: 1px solid #ccc;
}
.thumbnail-preview .grid-cell {
    border: none;
    width: 100%;
    height: 100%;
}
.export-section {
    background: #fff;
    margin: 24px;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    padding: 16px;
    max-width: 700px;
}
#cpp-export-output {
    width: 100%;
    margin-top: 10px;
    font-family: monospace;
    font-size: 1em;
    background: #f9f9f9;
    border: 1px solid #ccc;
    border-radius: 4px;
    resize: vertical;
}
button {
    background: #e9e9e9;
    border: 1px solid #bbb;
    border-radius: 4px;
    padding: 6px 14px;
    font-size: 1em;
    cursor: pointer;
    transition: background 0.15s;
}
button:hover:not(:disabled) {
    background: #d0e6ff;
}
button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
@media (max-width: 900px) {
    .main-content-area {
        flex-direction: column;
        align-items: center;
    }
    .editor-section, .preview-section {
        min-width: 0;
        width: 95vw;
    }
    .grid-2x2-container {
        grid-template-columns: repeat(2, 90px);
        grid-template-rows: repeat(2, 90px);
    }
    .grid-container {
        width: 90px;
        height: 90px;
    }
}
.export-section label {
    display: block;
    margin-bottom: 4px;
    font-weight: 500;
}
#animation-name-input {
    width: 220px;
    font-size: 1em;
    padding: 5px 8px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    display: block;
}
.export-buttons {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
#frame-indicator {
    margin-bottom: 8px;
    font-size: 1em;
    color: #444;
    font-weight: 500;
}
.drawing-toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
    align-items: center;
}
.tool-btn {
    background: #f3f3f3;
    border: 1.5px solid #bbb;
    border-radius: 5px;
    font-size: 1.3em;
    padding: 6px 12px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    outline: none;
}
.tool-btn:hover:not(.active) {
    background: #e0eaff;
    border-color: #7abaff;
}
.tool-btn.active {
    background: #007bff;
    color: #fff;
    border-color: #0056b3;
} 
