body {
    background-color: black;
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-family: monospace;
    overflow-y: auto;
    color: white;
    padding: 20px;
}

h1 {
    color: #ff0000;
    font-family: monospace;
    margin-bottom: 20px;
    font-size: 24px;
    text-shadow: 0 0 10px rgba(255, 0, 0, 0.5);
    letter-spacing: 2px;
    text-align: center;
}

.main-container {
    display: flex;
    flex-direction: row;
    gap: 30px;
    align-items: flex-start;
    justify-content: center;
    flex-wrap: wrap;
    width: 100%;
    max-width: 1400px;
}

.preview-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    min-width: 400px;
}

canvas {
    display: block;
    margin-bottom: 15px;
    border: 1px solid #333;
    max-width: 100%;
    height: auto;
    background-color: black;
}

.controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 420px;
    background: #111;
    padding: 20px;
    border-radius: 8px;
    box-sizing: border-box;
    border: 1px solid #333;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 13px;
    font-family: Arial, sans-serif;
}

.control-group label {
    font-weight: bold;
    color: #ddd;
}

.control-group input[type="text"],
.control-group input[type="number"],
.control-group select,
.control-group textarea {
    padding: 8px;
    background: #222;
    color: white;
    border: 1px solid #444;
    border-radius: 4px;
    font-family: monospace;
    width: 100%;
    box-sizing: border-box;
}

.control-group textarea {
    resize: vertical;
    height: 90px;
}

.dimension-inputs {
    display: flex;
    gap: 10px;
}

input[type="range"] {
    width: 100%;
    height: 8px;
    -webkit-appearance: none;
    background: #444;
    border-radius: 4px;
    outline: none;
    margin: 5px 0;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: #ff0000;
    border-radius: 50%;
    cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #ff0000;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.export-buttons {
    display: flex;
    gap: 10px;
    width: 100%;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.export-buttons button {
    flex: 1;
    min-width: 130px;
    padding: 12px 15px;
    font-size: 13px;
    background-color: #ff0000;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-family: Arial, sans-serif;
    box-sizing: border-box;
}

.export-buttons button:nth-child(2) {
    background-color: #00aa22;
}

.export-buttons button:nth-child(3) {
    background-color: #00aaff;
}

.export-buttons button:hover {
    opacity: 0.9;
}

#status {
    color: white;
    margin-top: 10px;
    font-size: 14px;
    text-align: center;
    min-height: 20px;
}

.progress-container {
    width: 100%;
    height: 24px;
    background: #222;
    border-radius: 4px;
    margin-top: 10px;
    display: none;
    overflow: hidden;
    position: relative;
}

.progress-bar {
    height: 100%;
    background: #ff0000;
    width: 0%;
    transition: width 0.1s;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.color-presets {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 5px;
}

.preset-btn {
    padding: 6px 10px;
    font-size: 11px;
    border: 1px solid #555;
    border-radius: 4px;
    cursor: pointer;
    font-family: Arial, sans-serif;
    color: white;
    flex: 1 1 calc(33% - 6px);
    text-align: center;
    box-sizing: border-box;
}

.preset-btn:hover {
    opacity: 0.85;
    border-color: #fff;
}

.color-preview {
    height: 20px;
    border-radius: 4px;
    margin-top: 5px;
    background: linear-gradient(to right, #f00, #c00, #ff0000);
    border: 1px solid #444;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 5px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
    cursor: pointer;
}

.tooltip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background-color: #ff0000;
    color: white;
    border-radius: 50%;
    font-size: 10px;
    font-weight: bold;
    margin-left: 6px;
    cursor: help;
    position: relative;
    vertical-align: middle;
}

.tooltip-icon .tooltiptext {
    visibility: hidden;
    width: 220px;
    background-color: #222;
    color: #fff;
    text-align: center;
    border-radius: 4px;
    padding: 8px;
    position: absolute;
    z-index: 1000;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 12px;
    font-family: Arial, sans-serif;
    border: 1px solid #444;
}

.tooltip-icon:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

footer {
    margin-top: 30px;
    color: #888;
    font-size: 12px;
    text-align: center;
    font-family: Arial, sans-serif;
}

footer a {
    color: #ff0000;
    text-decoration: none;
    margin: 0 5px;
}

footer a:hover {
    text-decoration: underline;
}

.toggle-controls-btn {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    background-color: #00ff33;
    color: #000;
    border: none;
    padding: 12px 18px;
    border-radius: 30px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 255, 51, 0.4);
}

.controls-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #333;
    padding-bottom: 10px;
    margin-bottom: 10px;
}

.controls-header h3 {
    margin: 0;
    font-size: 16px;
    color: #00ff33;
}

.reset-btn {
    background: #333;
    color: #fff;
    border: 1px solid #555;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.reset-btn:hover {
    background: #555;
}

@media (max-width: 900px) {
    .toggle-controls-btn {
        display: block;
    }
    .controls {
        display: none;
        position: fixed;
        top: 60px;
        left: 10px;
        right: 10px;
        max-height: 80vh;
        overflow-y: auto;
        z-index: 999;
        box-shadow: 0 10px 30px rgba(0,0,0,0.8);
    }
    .controls.active {
        display: flex;
    }
}

@media (max-width: 1024px) {
    .main-container {
        flex-direction: column;
        align-items: center;
    }

    .preview-container {
        min-width: auto;
        width: 100%;
    }

    .controls {
        width: 100%;
        max-width: 600px;
    }
}

@media (max-width: 600px) {
    h1 {
        font-size: 20px;
    }

    .controls {
        padding: 15px;
    }

    .color-presets {
        justify-content: center;
    }

    .preset-btn {
        flex: 1 1 calc(50% - 6px);
    }
}