body {
    background-color: #f8fafc;
    margin: 0px;
    color: #111827;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    height: 100%;
    overflow: hidden;
}
html {
    height: 100%;
    margin: 0px;
}
#toolbar {
    position: fixed;
    top: 12px;
    right: 12px;
    left: 12px;
    z-index: 10;
    display: flex !important;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    justify-content: flex-end;
    color: #111827;
    width: auto;
    height: auto;
    overflow: visible;
    pointer-events: none;
}
#toolbar > div {
    float: none;
    pointer-events: auto;
}
#toolbar > table {
    pointer-events: auto;
}
#statusbar > div {
    float: none;
    display: grid;
    min-height: 32px;
    place-items: center;
    border-left: 1px solid rgba(15, 118, 110, 0.28);
    text-align: center;
}
#controls {
    order: 2;
    padding: 4px;
    border: 1px solid rgba(116, 99, 72, 0.22);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 8px 18px rgba(37, 35, 28, 0.12);
    backdrop-filter: blur(12px);
}
#controls td div {
    background-color: #ffffff;
    width: 24px;
    height: 24px;
    margin: 2px 1px;
    border: 1px solid rgba(100, 116, 139, 0.24);
    border-radius: 6px;
    font-weight: bold;
    text-align: center;
    cursor: pointer;
    box-shadow: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    font-size: 82%;
    line-height: 22px;
}
#controls td div:hover {
    background: #ccfbf1;
    color: #115e59;
}
#statusbar {
    position: fixed;
    right: 14px;
    bottom: 14px;
    left: 14px;
    display: flex !important;
    flex-wrap: wrap;
    align-items: center;
    gap: 0;
    height: auto;
    font-size: 13px;
    z-index: 11;
    width: auto;
    max-width: calc(100vw - 28px);
    text-shadow: none;
    -webkit-user-select: none;
    -moz-user-select: none;
}
#label_step:before {
    content: "Step: ";
}
#label_fps:before {
    content: "FPS: ";
}
#label_gen:before {
    content: "Gen: ";
}
#label_pop:before {
    content: "Pop: ";
}
#label_gen, #label_pop, #label_mou, #label_zoom, #label_step, #label_fps {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.94);
    color: #115e59;
    font-weight: 750;
}
.button, .menu {
    order: 1;
    margin-top: 0;
}
.button, .menu > div {
    box-sizing: border-box;
    display: inline-grid;
    height: 34px;
    flex: 0 0 auto;
    place-items: center;
    width: auto !important;
    max-width: max-content;
    background-color: #ffffff;
    cursor: pointer;
    min-height: 0;
    padding: 0 10px;
    margin: 0;
    border: 1px solid rgba(15, 118, 110, 0.22);
    border-radius: 8px;
    box-shadow: 0 8px 18px rgba(37, 35, 28, 0.1);
    color: #115e59;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    text-align: center;
    -webkit-user-select: none;
    -moz-user-select: none;
}
.button:hover, .menu > div:hover {
    border-color: rgba(15, 118, 110, 0.55);
    background: #ccfbf1;
}
#run_button {
    border-color: #0f766e;
    background: #0f766e;
    color: #ffffff;
}
#run_button:hover {
    background: #115e59;
    color: #ffffff;
}
/*
.menu {
    overflow: hidden;
    height: 20px;
}
.menu:hover {
    height: auto;
    padding-bottom: 50px;
}
*/
#overlay {
    background-color: #ffffff;
    position: absolute;
    top: 50px;
    padding: 20px 5px 50px;
    font-size: 13px;
    color: #111827;
    z-index: 10;
    line-height: 1.4;
    border-style: solid;
    border-color: rgba(116, 99, 72, 0.22);
    border-width: 2px 0px;
    width: 100%;
    box-shadow: 0 18px 45px rgba(37, 35, 28, 0.18);
}
@media (min-width: 850px) {
    #overlay {
        border-width: 2px;
        border-radius: 8px;
        left: 50%;
        margin-left: -400px;
        width: 700px;
        padding: 50px;
    }
}
@media (max-width: 800px) {
    #label_mou {
        display: none;
    }
    #toolbar .button, #toolbar .menu > div {
        height: 32px;
        padding: 0 8px;
    }
    .not_on_small_screen {
        display: none;
    }
}
#pattern_name {
    order: -1;
    flex: 1 1 auto;
    margin-right: auto;
    max-width: 42%;
    min-width: 120px;
    overflow: hidden;
    padding: 6px 0;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
}
.button2 {
    border: 1px solid rgba(15, 118, 110, 0.32);
    border-radius: 8px;
    cursor: pointer;
    padding: 8px 16px;
    margin: 0px 8px;
    background: #ffffff;
    color: #115e59;
    font-weight: 800;
}
.button2:hover {
    background-color: #ccfbf1;
}
#import_text {
    background-color: #f8fafc;
    border: 1px solid rgba(100, 116, 139, 0.28);
    border-radius: 8px;
    display: block;
    width: 100%;
    height: 200px;
    color: #111827;
    padding: 10px;
}
#loading {
    font-family: monospace;
    text-align: center;
    font-size: 36px;
}
.loading-panel {
    color: #111827;
    font-size: 16px;
}
.loading-card {
    display: grid;
    justify-items: center;
    gap: 14px;
    margin: 0 auto;
    max-width: 360px;
    text-align: center;
}
.loading-card h2 {
    color: #115e59;
    font-size: 22px;
    letter-spacing: 0;
    margin: 0;
}
.loading-card p {
    color: #475569;
    margin: 0;
}
.life-loader {
    display: grid;
    grid-template-columns: repeat(3, 14px);
    gap: 6px;
    padding: 14px;
    border: 1px solid rgba(15, 118, 110, 0.18);
    border-radius: 8px;
    background: #f0fdfa;
    box-shadow: 0 14px 32px rgba(37, 35, 28, 0.12);
}
.life-loader span {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    background: #0f766e;
    opacity: 0.28;
    animation: life-loader-pulse 1.2s ease-in-out infinite;
}
.life-loader span:nth-child(1),
.life-loader span:nth-child(5),
.life-loader span:nth-child(7) {
    opacity: 1;
}
.life-loader span:nth-child(2),
.life-loader span:nth-child(6) {
    animation-delay: 0.15s;
}
.life-loader span:nth-child(3),
.life-loader span:nth-child(8) {
    animation-delay: 0.3s;
}
.life-loader span:nth-child(4),
.life-loader span:nth-child(9) {
    animation-delay: 0.45s;
}
@keyframes life-loader-pulse {
    0%, 100% {
        opacity: 0.28;
        transform: scale(0.88);
    }
    45% {
        opacity: 1;
        transform: scale(1);
    }
}
input[type=number], input[type=text] {
    border: 1px solid rgba(100, 116, 139, 0.28);
    border-radius: 8px;
    color: #111827;
    background-color: #ffffff;
    padding: 7px;
    width: 110px;
    text-align: center;
}
input[type=color] {
    width: 44px;
    height: 34px;
    padding: 3px;
    border: 1px solid rgba(100, 116, 139, 0.28);
    border-radius: 8px;
    background: #ffffff;
    cursor: pointer;
}
a, .link {
    color: #115e59;
    padding: 0px 1px;
    cursor: pointer;
    text-decoration: none;
}
a:hover, .link:hover {
    text-decoration: underline;
}
#pattern_description {
    white-space: pre-wrap;
}
#alert_text {
    max-height: 300px;
    overflow: auto;
}
canvas {
    position: absolute;
}
#pattern_list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 4px 18px;
    max-height: min(56vh, 520px);
    margin-bottom: 18px;
    overflow-x: hidden;
    overflow-y: auto;
    padding-right: 8px;
}
#pattern_list > div {
    border-radius: 6px;
    cursor: pointer;
    min-width: 0;
    padding: 4px 6px;
}
#pattern_list > div:hover {
    color: #115e59;
    background-color: #ccfbf1;
}
#pattern_chooser span.size {
    color: #64748b;
    font-size: 80%;
    margin-left: 7px;
}
br.clear {
    clear: both;
}
.left {
    float: left;
}
.right {
    float: right;
}
#overlay h2 {
    margin-top: 0;
}
#pattern_file_container, #pattern_link_container, #pattern_urls {
    overflow: hidden;
    text-overflow: ellipsis;
}
