body {
    margin: 0;
    overflow: hidden;
    background-color: #1a1a1a; /* Dark background */
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
    filter: blur(0.5px);
}

.controls {
    position: fixed;
    top: 10px;
    left: 50%; /* Center horizontally */
    transform: translateX(-50%); /* Adjust for the element's width */
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 10px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    gap: 10px; /* Space between elements */
    z-index: 10; /* Ensure controls are above canvas */
}

.controls label {
    font-family: sans-serif;
    font-size: 14px;
}

.controls input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 150px; /* Adjust width as needed */
    height: 8px;
    background: #d3d3d3;
    outline: none;
    opacity: 0.7;
    transition: opacity .2s;
    border-radius: 4px;
}

.controls input[type="range"]:hover {
    opacity: 1;
}

.controls input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: #4CAF50; /* Green thumb */
    cursor: pointer;
    border-radius: 50%;
}

.controls input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #4CAF50; /* Green thumb */
    cursor: pointer;
    border-radius: 50%;
}

.controls span {
    font-family: monospace;
    font-size: 14px;
    min-width: 20px; /* Give it a fixed width to prevent jumpiness */
    text-align: right;
}

.warning {
    display: none; /* Hidden by default */
    color: orange;
    font-family: sans-serif;
    font-size: 12px;
    margin-left: 10px;
    padding: 5px;
    border: 1px solid orange;
    border-radius: 3px;
}

.sidebar {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.7);
    padding: 15px;
    border-radius: 0 10px 10px 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 20;
}

.object-button {
    width: 60px;
    height: 60px;
    background-color: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    cursor: pointer;
    padding: 5px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.object-button.delete-mode {
    border-color: #ff4444;
    box-shadow: 0 0 8px rgba(255, 0, 0, 0.5);
}

.object-button:hover {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

.object-button img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.object-button canvas {
    width: 100%;
    height: 100%;
}

.toggle-container {
    display: flex;
    align-items: center;
    margin-left: 15px;
    cursor: pointer;
}

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

.toggle-label {
    color: white;
    font-family: sans-serif;
    font-size: 14px;
    user-select: none;
}

.delete-button {
    background-color: #ff4444;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    margin-left: 15px;
    transition: background-color 0.3s;
}

.delete-button.active {
    background-color: #cc0000;
}

.delete-button:hover {
    background-color: #ff0000;
}

.background-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 15px;
}

.background-controls label {
    color: white;
    font-family: sans-serif;
    font-size: 14px;
}

.background-controls select {
    padding: 5px;
    border-radius: 4px;
    border: 1px solid #ccc;
    background-color: rgba(255, 255, 255, 0.8);
    font-family: sans-serif;
    font-size: 12px;
    cursor: pointer;
}

#clearBackground {
    background-color: #666;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background-color 0.3s;
}

#clearBackground:hover {
    background-color: #888;
}