html {
  font-family: system-ui, sans-serif;
  font-size: 75%;
  height: 100%;
}

/* html, body { */
/*   height: 100%; */
/* } */

body {
  background: #dedcd7;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  margin: 0;
}

@import url('https://fonts.googleapis.com/css2?family=Anaheim:wght@400..800&display=swap');
p {
  font-family: "Anaheim", sans-serif;
  color: black;
  font-weight: 400;
  font-style: normal;
  margin: 0;
}

.top-text {
  display: flex;
  align-items: center;
  gap: .7rem;
  border-bottom: 1px solid #777;
  margin: 0;
  justify-content: space-between;
  background-color: #ddd;
}

#toggle-info {
  background: none;
  color: black;
  border: none;
  cursor: pointer;
  margin: 10px;
  padding-top: 5px;
}

.app-layout {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.info-panel {
  display: block;
  padding: 1rem;
  background-color: #c5c1be;
  border-bottom: 1px solid #777;
}

.info-panel.collapsed {
  display: none;
}

.pixel-column {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.canvas-area {
  flex-direction: column;
  flex: 1;
  min-height: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  overflow: hidden;

  padding-top: 10px;
  padding-bottom: 10px;
}

/* main area */
.pixel-grid {
  aspect-ratio: 1 / 1;
  width: min(90vmin, 90%);
  max-height: 100%;
  margin: auto;

  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 7px;
}

.pixel {
  background-color: #777;
  box-shadow: 0 0px 4px rgba(0, 0, 0, .4);
  border-radius: 4px;
  transition: background-color .14s linear, transform .07s ease-in;
  transform: scale(1);
  opacity: 0;
  animation: fadeIn .7s forwards;
  animation-delay: calc(var(--i) * 0.15s);
}

.pixel-active {
  transform: scale(.96);
}

.palette {
  display: flex;
  gap: 12px;
  padding: .85rem;

  overflow-x: auto;
  overflow-y: hidden;

  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.palette::-webkit-scrollbar {
  display: none;
}

.palette-bar {
  flex-shrink: 0;
  position: sticky;
  bottom: 0;
  background-color: #b2b1a9;
  color: black;
  text-align: center;
  padding: .1rem 0px;

  border-top: 1px solid #777;

  z-index: 1;
}

.color-swatch {
  flex: 0 0 auto;
  position: relative;
  cursor: pointer;

  height: 5vh;
  aspect-ratio: 1;

  align-self: center;
  margin: auto .1rem;
  border-radius: 4px;
  box-shadow: 0 0px 4px rgba(0, 0, 0, .4);
  background-color: #ff00ff;

  border: 2px solid transparent;

  opacity: 0;
  animation: fadeIn 1s forwards;
  animation-delay: calc(var(--i) * 0.08s);
}

.color-swatch.selected {
  border-color: #333;
}

.color-swatch::after {
  content: "✓";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 4vh;
  color: white;
  opacity: 0;
  pointer-events: none;
}

.color-swatch.selected::after {
  opacity: 1;
}

/* mobile landscape */
@media (orientation: landscape), (min-width: 900px) {
  .app-layout {
    flex-direction: row;
  }

  .info-panel {
    display: block;
    width: 30vw;
    max-width: 400px;
    overflow-y: auto;
    border-right: 1px solid #777;
    font-size: 3vh;
  }

  .pixel-column {
    flex: 1;
  }

  .color-swatch {
    height: 10vh
  }

  .color-swatch::after {
    font-size: 6vh;
  }

  .palette {
    padding: 1vw;
  }
}

@keyframes fadeIn {
  /* 0% { opacity: 0; } */
  /* 100% { opacity: 1; } */
  to {
    opacity: 1;
  }
}

