* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
  font-family: Arial, sans-serif;
}

header,
main,
footer {
  padding: 1rem;
}

main {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  flex-wrap: wrap;
}

.button-bar {
  display: flex;
  flex-direction: column;
  margin: 1rem 0;
  max-width: 30rem;
  min-width: 10rem;
  width: 50%;
}

button,
input {
  margin: 0.5rem 0;
  font-size: 1rem;
  padding: 0.5rem 1rem;
  cursor: pointer;
}

button:disabled,
input:disabled {
  background-color: #ccc;
  cursor: not-allowed;
  color: #666;
}

.button-bar button,
.button-bar a#tutorialLink {
  margin: 0.5rem 0;
  font-size: 1rem;
  padding: 0.5rem 1rem;
  cursor: pointer;
  background-color: #007bff;
  color: #fff;
  text-decoration: none;
  border: none;
  border-radius: 4px;
  text-align: center;
}

.button-bar button:disabled,
.button-bar a#tutorialLink:disabled {
  background-color: #ccc;
  cursor: not-allowed;
  color: #666;
}

canvas {
  border: 1px solid #ccc;
  -webkit-user-select: none; /* Safari */
  -moz-user-select: none; /* Firefox */
  -ms-user-select: none; /* Internet Explorer/Edge */
  user-select: none; /* Non-prefixed version, currently supported by Chrome, Opera and Edge */
  min-width: 10rem;
}

#magnifierCanvas {
  align-self: flex-end;
  height: auto;
  max-width: 15rem;
  width: 50%;
  position: sticky;
  top: 0;
  margin-left: auto;
}

@media (max-width: 30rem) {
  .button-bar {
    width: 100%;
    margin-right: 0;
  }
  #magnifierCanvas {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
  }
}

#overlayCanvas {
  border: none;
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
}

#canvas {
  width: 100%;
  max-width: 100%;
  height: auto;
  margin-bottom: 1rem;
}
