* {
    min-height: 0;
    min-width: 0;
    word-wrap: break-word;
    box-sizing: border-box;
    font-size: 1em;
}

#coords {
    display: none;
}

input {
    width: 4em;
}

button {
    width: auto;
    height: auto;
}

.control_wrapper_wrapper {
    display: flex;
}

.rules_wrapper {
    display: none;
    overflow: visible;
    width: 100%;
    height: 100%;
    z-index: 20;
    justify-self: start;
    alight-self: start;
    padding: 20px;
    background-color: #cccccc;
}

.rules {
    width: 80%;
    height: 80%;
    position: relative;
    width: auto;
    height: auto;
    overflow: visible;
}

.app_wrapper_wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.app_wrapper {
    width: 95vw;
    height: 95vh;
    display: flex;
    overflow: visible;
}

.canvas_wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    touch-action: none;
}

.canvas_wrapper canvas {
    display: block;
    /*display: none;*/
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: scale-down;
    border-style: solid;
}

.control_wrapper {
    position: relative;
    max-height: 100%;
    max-width: 100%;
    flex-shrink: 0;
    display: flex;
    min-height: 30vh;
    flex-direction: column;
    justify-content: center;
}

.coordinate_controls {
    position: relative;
    max-height: 100%;
    max-width: 100%;
    min-width: 30%;
    display: flex;
    margin: 5px;
}

.center_coord_wrapper {
    display: flex;
}

.info_wrapper {
    position: relative;
    max-height: 100%;
    max-width: 100%;
    display: flex;
}

.target_wrapper {
    position: relative;
    max-height: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.target_canvas_wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    object-fit: scale-down;
    z-index: -30;
    max-width: 20vw;
    max-height: 20vw;
}

.target_canvas_wrapper canvas {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: scale-down;
    border-style: solid;
}

.zoom_wrapper {
    display: flex;
}

.coord_wrapper {
    margin: 5px;
}

.coord_wrapper label {
    margin: 5px;
}

#new_target {
    margin: 5px;
}

@media (orientation: landscape) {
    .app_wrapper {
	flex-direction: row;
    }
    
    .canvas_wrapper {
	width: 95vh;
	height: 95vh;
    }

    .canvas_wrapper canvas {
	width: 100%;
	height: 100%;
    }
    .coordinate_controls {
	flex-direction: column;
    }
    .info_wrapper {
	flex-direction: column;
	justify-content: center;
	align-items: center;
    }
    .target_wrapper {
	justify-content: center;
    }
    .zoom_wrapper {
	flex-direction: column;
    }
    .control_wrapper_wrapper {
	min-width: 40vw;
	margin-left: 10px;
    }
}

@media (orientation: portrait) {
    .app_wrapper {
	flex-direction: column;
	justify-content: center;
	align-items: center;
	object-fit: scale-down;
    } 
    .canvas_wrapper {
	max-height: 80%;
	max-width: 80%;
    }
    .info_wrapper {
	flex-direction: row;
    }
    .target_canvas_wrapper {
	max-height: 50%;
	max-width: 50%;
    }
    .control_wrapper {
	justify-content: center;
	align-items: center;
    }
    .coordinate_controls {
	flex-direction: column;
	justify-content: center;
	align-items: center;
    }

    .coord_wrapper {
	display: flex;
	flex-direction: row;
	justify-content: center;
	align-items: center;
    }
    .zoom_wrapper {
	flex-direction: row;
    }
}

@media only screen and (max-width: 700px) {
    
    body {
	/*overflow: hidden;*/
    }

    .app_wrapper_wrapper {
	justify-content: flex-start;
	flex-direction: column;
    }
    
    .app_wrapper {
	justify-content: flex-start;
    }
	
    .canvas_wrapper {
	max-height: 80%;
	max-width: 80%;
	overflow: hidden;
    }
    
    .target_canvas_wrapper canvas {
    }
    
    .control_wrapper {
	justify-content: flex-start;
    }

}

@media only screen and (max-width: 700px) and (orientation: landscape) {
    .target_canvas_wrapper {
	max-height: 40%;
	max-width: 40%;
	z-index: -30;
    }
}
