body, p {
  margin: 0px;
  touch-action: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.file-upload {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px;
  padding: 12px;
  background: #f5f5f5;
  border-bottom: 1px solid #ddd;
}

.file-upload input[type=file] {
  max-width: 50vw;
}

.file-upload button {
  background: #333;
  color: #fff;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9em;
  white-space: nowrap;
  flex-shrink: 0;
}

.file-upload button:hover {
  background: #555;
}

#canvas {
  display: block;
  margin: 0 auto;
  aspect-ratio: 3/4;
  width: min(100vw, 480px);
}

.button-container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.button-container > p {
  display: flex;
  width: 100%;
  justify-content: center;
}

.button-container > p > button {
  width: min(20vw, 96px);
  height: 2vh;
  margin: 0.2em;
  font-size: 0.5em;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.tutorial-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.tutorial-overlay.visible {
  display: flex;
}

.tutorial-modal {
  background: #fff;
  border-radius: 8px;
  padding: 24px;
  max-width: 400px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.tutorial-modal h2 {
  margin: 0 0 16px 0;
  font-size: 1.5em;
  border-bottom: 2px solid #333;
  padding-bottom: 8px;
}

.tutorial-modal h3 {
  margin: 16px 0 8px 0;
  font-size: 1.1em;
  color: #333;
}

.tutorial-modal p {
  margin: 8px 0;
  line-height: 1.5;
}

.tutorial-modal .note {
  color: #666;
  font-size: 0.9em;
}

.tutorial-modal table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0;
  font-size: 0.9em;
}

.tutorial-modal td {
  padding: 6px 8px;
  border-bottom: 1px solid #eee;
}

.tutorial-modal td:first-child {
  white-space: nowrap;
}

.tutorial-modal kbd {
  background: #f4f4f4;
  border: 1px solid #ccc;
  border-radius: 3px;
  padding: 2px 6px;
  font-family: monospace;
  font-size: 0.9em;
}

.tutorial-footer {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tutorial-footer label {
  font-size: 0.9em;
  color: #666;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tutorial-footer button {
  background: #333;
  color: #fff;
  border: none;
  padding: 8px 20px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1em;
}

.tutorial-footer button:hover {
  background: #555;
}