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

body {
    margin: 0;
    background: #222;
    text-align: center;
    min-height: 100vh;
    font-family: Arial, sans-serif;
    padding: 10px;
}

#lmao {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px;
    gap: 20px;
}

#mainContainer {
    /* display: flex; */
    gap: 15px;
    padding: 15px;
    border-radius: 5px;
    max-width: 1200px;
}

#canvasSection {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

#canvasContainer {
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2px solid white;
    background: white;
    overflow: hidden;
    width: fit-content;
    transform-origin: center;
}

canvas {
    image-rendering: pixelated;
    background: white;
    display: block;
}

#controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

#colorPicker {
    width: 50px;
    height: 40px;
    cursor: pointer;
    border: none;
    border-radius: 3px;
}

button {
    padding: 8px 12px;
    background: #0066cc;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 13px;
}

button:hover {
    background: #0052a3;
}

#codeSection {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #2a2a2a;
    padding: 12px;
    border: 1px solid #555;
    border-radius: 5px;
    width: 550px;
}

#codeSection label {
    color: #aaa;
    font-weight: bold;
    font-size: 13px;
}

#codeOutput {
    background: #1a1a1a;
    color: white;
    font-family: 'Courier New', monospace;
    padding: 10px;
    border: 1px solid #444;
    border-radius: 3px;
    height: 450px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: 11px;
    line-height: 1.4;
    resize: vertical;
}

/* Custom scrollbar styling */
#codeOutput::-webkit-scrollbar {
    width: 8px;
}

#codeOutput::-webkit-scrollbar-track {
    background: transparent;
}

#codeOutput::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: content-box;
}

#codeOutput::-webkit-scrollbar-thumb:hover {
    background-color: #777;
    background-clip: content-box;
}

/* Firefox scrollbar */
#codeOutput {
    scrollbar-color: #555 transparent;
    scrollbar-width: thin;
}

.code-line {
    display: block;
    margin: 1px 0;
}

#coordDisplay {
    color: #888;
    font-size: 12px;
    height: 16px;
}

#zoomLevel {
    color: #888;
    font-size: 12px;
    height: 16px;
}

#codeButtons {
    display: flex;
    gap: 8px;
}

#codeButtons button {
    flex: 1;
    padding: 6px 8px;
    font-size: 12px;
}

#optimizedCodeSection {
    display: none;
    flex-direction: column;
    gap: 8px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #555;
}

#optimizedCodeSection.active {
    display: flex;
}

#optimizedCodeSection label {
    color: #aaa;
    font-weight: bold;
    font-size: 13px;
}

#optimizedCodeOutput {
    background: #1a1a1a;
    color: white;
    font-family: 'Courier New', monospace;
    padding: 10px;
    border: 1px solid #444;
    border-radius: 3px;
    height: 450px;
    overflow-x: auto;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: 11px;
    line-height: 1.4;
    resize: vertical;
}

/* Custom scrollbar for optimized code */
#optimizedCodeOutput::-webkit-scrollbar {
    width: 8px;
}

#optimizedCodeOutput::-webkit-scrollbar-track {
    background: transparent;
}

#optimizedCodeOutput::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: content-box;
}

#optimizedCodeOutput::-webkit-scrollbar-thumb:hover {
    background-color: #777;
    background-clip: content-box;
}

#optimizedCodeOutput {
    scrollbar-color: #555 transparent;
    scrollbar-width: thin;
}

#optimizedCodeButtons {
    display: flex;
    gap: 8px;
}

#optimizedCodeButtons button {
    flex: 1;
    padding: 6px 8px;
    font-size: 12px;
}

input[type="checkbox"] {
    margin-right: 5px;
    cursor: pointer;
}

label.checkLabel {
    color: #aaa;
    font-size: 12px;
    display: flex;
    align-items: center;
    cursor: pointer;
}

#sizeControls {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 10px;
}

.size-input-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.size-input-group label {
    color: #aaa;
    font-size: 12px;
    width: 60px;
}

.size-input-group input {
    width: 70px;
    padding: 5px 8px;
    background: #333;
    color: #0f0;
    border: 1px solid #555;
    border-radius: 3px;
    font-family: monospace;
    font-size: 12px;
}

.size-input-group input:focus {
    outline: none;
    border-color: #0f0;
    box-shadow: 0 0 5px rgba(0, 255, 0, 0.3);
}