:root {
  --clr-bg: #1f324f;
  --clr-blue: #2b476f;
  --clr-grid: #0000001e;
  --clr-red: #eb5c47;
  --clr-white: #fff;
  --clr-hover: #f1f1f1;

  --board-width: 580px;
  --board-height: 700px;
  --grid-width: 500px;
  --grid-height: 500px;

  --ff-primary: "Mochiy Pop One", sans-serif;
  --ff-fallback: sans-serif;
}

* {
  box-sizing: border-box;
}

.container {
  background-color: var(--clr-bg);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4rem;
  min-height: 100vh;
}

.menu {
  background-color: var(--clr-blue);
  display: flex;
  flex-direction: column;
  width: 350px;
  height: 700px;
  border-radius: 30px;
}

.menu-container {
  width: 100%;
  padding: 2rem;
  display: flex;
  flex-direction: column;
}

.menu-heading {
  font-family: var(--ff-primary);
  font-size: 1.5rem;
  color: var(--clr-white);
}

.menu-color {
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
}

.menu-color-picker {
  cursor: pointer;
  border: none;
  border-radius: 5px;
  padding: 0;
  width: 30%;
  height: 2.5rem;
}

.menu-color-picker:focus {
  outline: 1px solid var(--clr-white);
  border-radius: 1px;
}

.menu-text {
  font-size: 1.1rem;
  font-family: var(--ff-fallback);
  color: var(--clr-white);
  padding-top: 1.2rem;
  line-height: 1.5;
}

.menu-grid-input-container {
  display: flex;
  justify-content: space-between;
  padding-top: 1rem;
}

.menu-grid-input {
  width: 30%;
  height: 2.5rem;
  font-size: 1.2rem;
  border-radius: 5px;
  border: none;
  text-align: center;
  font-weight: 700;
  background-color: var(--clr-bg);
  color: white;
}

.menu-grid-input:focus {
  outline: 1px solid white;
}

.invalid-input-message {
  display: none;
  color: white;
  font-family: var(--ff-fallback);
  margin-top: 1rem;
  font-size: .9rem;
  color: var(--clr-white);
}

.menu-container.grid-switch,
.menu-container.menu-rainbow-toggle {
  justify-content: space-between;
}

.switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 34px;
}

.switch-input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-input:checked + .slider {
  background-color: var(--clr-red);
}

.switch-input:checked + .slider:before {
  -webkit-transform: translateX(26px);
  -ms-transform: translateX(26px);
  transform: translateX(26px);
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  -webkit-transition: .4s;
  transition: .4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  -webkit-transition: .4s;
  transition: .4s;
}

.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}

.menu-container.heading-wrapper {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  padding: 0;
}

.rainbow-toggle:checked {
  background-color: var(--clr-red);
}

.board {
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  align-items: center;
  background-color: var(--clr-red);
  width: var(--board-width);
  height: var(--board-height);
  border-radius: 30px;
}

.title {
  font-family: var(--ff-primary);
  font-size: 2rem;
  color: var(--clr-white);
}

.grid {
  background-color: var(--clr-white);
  width: var(--grid-width);
  height: var(--grid-height);
  display: flex;
  flex-wrap: wrap;
  overflow: hidden;
}

.grid-item {
  flex: 1 0 calc(100% / var(--grid-size));
  height: calc(100% / var(--grid-size));
}

.grid-item.grid-on {
  border: 1px solid var(--clr-grid);
}

.buttons {
  display: flex;
  justify-content: center;
  width: var(--grid-width);
}

.btn {
  cursor: pointer;
  font-size: 16px;
  font-family: var(--ff-primary);
  color: var(--clr-red);
  background-color: var(--clr-white);
  padding: 8px 16px;
  border: none;
  border-radius: 5px;
}

.btn:hover {
  background-color: var(--clr-hover);
}

.btn-grid-size {
  width: 30%;
  background-color: var(--clr-white);
  color: var(--clr-red);
}

.btn-grid-size:hover {
  background-color: var(--clr-hover);
}