/* Reset and typography */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 1.125rem;
  line-height: 1.4;
  padding: 16px;
}

button, input {
  font: inherit;
}

button {
  padding: 0 4px;
}

h1, h2, h3, h4, h5, h6, button, input {
  line-height: 1.2;
}

/* Structural stuff */

body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: 100vh;
  min-height: 40rem;
}

.simulator {
  display: flex;
  flex: 1;
  flex-shrink: 1;
  @media (width < 40rem) {
    flex-direction: column;
  }
  gap: 16px;
}

.objective-sidebar {
  flex: 1;
  min-width: 15rem;
  position: relative;
}

.objective-sidebar-inner {
  /*
   * position: absolute is the only way I've found
   * to stop the objective sidebar from overflowing.
   */
  inset: 0;
  overflow-y: auto;
  position: absolute;
}

.objective-sidebar h2 {
  margin-top: 8px;
}

.object-list {
  list-style: none;
}

.canvas-section {
  display: flex;
  flex: 3;
  flex-direction: column;
  gap: 8px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.object-toolbar button {
  font-size: 1.4rem;
  min-width: 2rem;
  text-align: center;
}

.canvas-wrapper {
  flex: 1;
  position: relative;
}

.canvas {
  aspect-ratio: auto;
  cursor: grab;
  display: block;
  height: 100%;
  image-rendering: pixelated;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  inset: 0;
  position: absolute;
  width: 100%;
}

.canvas:active {
  cursor: grabbing;
}

.win-dialog {
  inset: 0;
  margin: auto;
  padding: 16px;
  text-align: center;
  width: 20rem;
}

.win-dialog::backdrop {
  backdrop-filter: blur(4px);
  background-color: #00000040;
}

.win-dialog-stars {
  font-size: 4rem;
  line-height: 0.75;
  margin-bottom: 16px;
  -webkit-user-select: none;
          user-select: none;
}

.win-dialog-buttons {
  display: flex;
  justify-content: space-between;
  margin-top: 16px;
}