html {
    color-scheme: light dark;
    --background: #1a1a1a;
    --secondary: #232323;
    --font-colour: #fafafa;

    @media (prefers-color-scheme: light) {
        --background: #fafafa;
        --secondary: #cccccc;
        --font-colour: #1a1a1a;
    }

    color: var(--font-colour);
    background-color: var(--background);

    background-image: radial-gradient(rgba(var(--font-colour-rgb, 250, 250, 250), 0.15) 1.2px,
        var(--background) 1.2px);
    background-size: 2.5em 2.5em;
    background-position: center;
    background-attachment: fixed;

    animation: move-background 500s ease infinite;

    font-family: 'Segoe UI',
    Tahoma,
    Geneva,
    Verdana,
    sans-serif;
    line-height: 1.5;
}

@keyframes move-background {
    0% {
        background-position: 0 0;
    }

    50% {
        background-position: 25% 25%;
    }

    100% {
        background-position: 0 0;
    }
}

body {
    min-height: 100vh;
    margin: 0;
    padding: 1rem;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: flex-start;
    gap: 1rem;
    background: transparent;
    color: var(--font-colour);
}

.celluland-viewer-container {
    flex: 1 1 60%;
    max-width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.celluland-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

canvas {
    border-radius: 6px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
    width: 100%;
    height: auto;
    display: block;
    max-width: 100%;
}

.celluland-ui-container {
    flex: 1 1 35%;
    min-width: 280px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
    border-radius: 15px;
    background: rgba(255 255 255 / 0.1);
    backdrop-filter: saturate(180%) blur(10px);
    border: 2px solid var(--font-colour);
    box-sizing: border-box;
    max-width: 100%;
}

.input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    width: 100%;
}

.input-label {
    font-weight: 600;
    user-select: none;
    color: var(--font-colour);
}

.celluland-ui-container input[type="button"],
.celluland-ui-container input[type="number"],
.celluland-ui-container select {
    width: 100%;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    border-radius: 6px;
    border: none;
    background: var(--background);
    color: var(--font-colour);
    box-sizing: border-box;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
    transition: background-color 0.2s ease, color 0.2s ease;
    cursor: pointer;
}

.celluland-ui-container input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;

    display: inline-block;
    width: 1.35em;
    height: 1.35em;
    border-radius: 6px;
    background-color: var(--background);
    vertical-align: middle;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.10);
    transition: background-color 0.2s, border-color 0.2s, box-shadow 0.2s;
    position: relative;
}

.celluland-ui-container input[type="checkbox"]:checked {
    background-color: var(--font-colour);
}

.bg-blue {
    background-color: #5a6cff;
    color: white;
    box-shadow: 0 0 10px #5a6cff80;
    padding: 1rem;
    border-radius: 12px;
}

.bg-green {
    background-color: #55cc66;
    color: white;
    box-shadow: 0 0 10px #55cc6680;
    padding: 1rem;
    border-radius: 12px;
}

.bg-red {
    background-color: #e65555;
    color: white;
    box-shadow: 0 0 10px #e6555580;
    padding: 1rem;
    border-radius: 12px;
}

.inner-block {
    display: block;
    word-wrap: break-word;
    word-break: break-word;
}

.block,
.inner-block {
    border-radius: 14px;
    padding: 1.25rem;
    margin: 0.5rem 0;
    border: 2px solid var(--font-colour);
    box-sizing: border-box;
    width: 100%;
    backdrop-filter: saturate(120%) blur(8px);
    transition: background-color 0.3s ease;
}

.inner-block:hover {
    background: rgba(var(--font-colour-rgb, 250, 250, 250), 0.12);
}

@media (max-width: 768px) {
    .celluland-container {
        flex-direction: column;
        padding: 0 1rem;
    }

    .celluland-viewer-container,
    .celluland-ui-container {
        flex: none;
        width: 100% !important;
        min-width: auto !important;
        max-width: 100% !important;
    }
}

.title {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-weight: 700;
    font-size: 2.8rem;
    color: var(--font-colour);
    letter-spacing: 0.05em;
    padding: 0 1rem;
    max-width: max-content;
    cursor: default;
    user-select: none;
    transition: filter 0.3s ease-in;
}

.title:hover {
    filter: blur(3px);
}