* {
    box-sizing: border-box;
}

html {
    background-image: url("bonchy.png");
}

html, body {
    padding: 0px;
    margin: 0px;
    height: 100%;
    font-family: sans-serif;
}

.floatbox {
    background-color: #ffffff;
    border: 0.5rem solid #000000;
    margin-top: 1rem;
    margin-bottom: 1rem;
}

#picker-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

#picker-screen > div {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: min(100%, 45em);
}

#picker-screen p {
    text-align: center;
}

#picker-screen > div > * {
    margin: 0.6em;
}

#start-button {
    font-size: 15pt;
    margin: auto;
    display: block;
}

#failed {
    display: none;
    color: red;
    font-weight: bold;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

#filename-container {
    display: inline-block;
}

#filename {
    margin: 0em 0.5em;
}

.spin {
    animation: spin 300ms infinite linear;
}

#game-screen {
    display: flex;
    height: 100%;
    align-items: flex-start;
    justify-content: center;
}

@media (orientation: portrait) {
    #game-screen {
        flex-direction: column;
    }
}

#canvas-container {
    aspect-ratio: 1 / 1;
    margin: auto 0px;
}

.container-landscape {
    height: 100%;
}

.container-portrait {
    flex: 1;
}

#canvas-wrapper {
    margin: 1em;
    aspect-ratio: 1 / 1;
    position: relative;

    border: 0.5em solid black;
    width: calc(100% - 2em);
    height: calc(100% - 2em);
}

.canvas {
    object-fit: contain;
    width: 100%;
    height: 100%;
    display: block;
    touch-action: none;
}

#layer-canvas {
    position: absolute;
    left: 0px;
    top: 0px;
    z-index: -1;
}

#hover-canvas {
    position: absolute;
    left: 0px;
    top: 0px;
    z-index: 999;
    pointer-events: none;
    opacity: 0.4;
}

#canvas {
    opacity: 0.7;
    image-rendering: pixelated;
}

#tools {
    display: inline flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    margin: auto 0px;
    font-size: 12pt;
}

button {
    background: #ffffff00;
    border: 0.3em solid black; 
    font-weight: bold;
    cursor: pointer;
    padding: 1px 4px;
}

button:hover {
    border-color: #018484;
    color: #018484;
}

button:active {
    border-color: #0b9e9e;
    color: #0b9e9e;
}

button:disabled {
    border-color: grey !important;
    color: grey !important;
    cursor: default !important;
}

input[type="file"] {
    display: none;
}

/* same as button */
#stl-picker-label {
    background: #ffffff00;
    border: 0.3em solid black; 
    font-weight: bold;
    cursor: pointer;
    padding: 1px 4px;
    display: inline-block;
}

#stl-picker-label:hover {
    border-color: #018484;
    color: #018484;
}

#stl-picker-label:active {
    border-color: #0b9e9e;
    color: #0b9e9e;
}

.disabled-picker {
    border-color: grey !important;
    color: grey !important;
    cursor: default !important;
}

#options {
    display: flex;
    flex-direction: column;
    row-gap: 0.5em;
}

#brush-size-container {
    margin: 0.5em;
}

#tools button {
    flex: 1 1 0;
    margin: 0.5em;
    font-size: 12pt;
}

.active-tool {
     color: #0b9e9e;
     border-color: #0b9e9e;
}

#info-display {
    position: absolute;
    right: 0px;
    top: 0px;
    text-align: right;
    font-family: monospace;
    font-size: 30pt;
    opacity: 0.7;
    background-color: #ffffffdd;
    border: 0.1em solid black;
    margin: 8px;
    pointer-events: none;
}

#time-counter {
    margin: 0.2em;
    color: #990000;
}

#layer-counter {
    margin: 0.2em;
}

#display-screen {
    display: flex;
    justify-content: center;
}

#display-screen > div {
    display: inline flex;
    flex-direction: column;
    align-items: center;
}

#renderers {
    display: flex;
    flex-direction: row;
    justify-content: center;
    flex-wrap: wrap;
}

.render-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0.5em;
}

.renderer {
    object-fit: contain;
    display: block;
    aspect-ratio: 1 / 1;
    width: min(calc(100% - 1em), 30em);
}

.result {
    margin: 0.5em 0px;
}

#download {
    margin: 0.5em 0px;
}
