:root {
  --primary-color: #2c3e50;
  --secondary-color: #2980b9;
  --accent-color: #f8c291;
  --done-color: #55efc4;
  --visited-color: #a29bfe;
  --current-color: #fab1a0;
  --min-color: #ff7675;
  --text-dark: #2d3436;
  --background-light: #fefefe;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Roboto", sans-serif;
  user-select: none;
}

body {
  background-color: var(--background-light);
  color: var(--text-dark);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: stretch;
}

/* Title CSS */
.title {
  background-color: var(--primary-color);
  color: white;
  font-size: 1.4em;
  padding-block: 0.7em;
  text-align: center;
  cursor: pointer;
}

/* Navbar CSS */
.navbar {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 1em;
  font-size: 16px;
  padding: 0.7em 0;
  background-color: var(--secondary-color);
  transition: all 0.4s ease;
}

.navbar a {
  all: unset;
  cursor: pointer;
  color: white;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 8px;
  background-color: var(--primary-color);
  transition: 0.3s;
}

.navbar a:hover {
  background-color: var(--accent-color);
  color: var(--primary-color);
}

.navbar #menu {
  padding: 6px 10px;
  border: none;
  border-radius: 6px;
  background-color: var(--primary-color);
  color: white;
  cursor: pointer;
}

.navbar > .icon {
  display: none;
}

/* Center Box */
.center {
  margin: 20px auto;
  width: 410px;
  height: 420px;
  max-height: 731px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.array {
  display: flex;
  height: 100%;
  padding: 1rem;
  flex-direction: row;
  align-items: flex-start;
}

.cell {
  flex: 0.5;
  width: 0.000001%;
  margin: 1px;
  background-color: #e0e0e0;
  border-radius: 4px;
  position: relative;
  transition: all 0.3s ease;
}

.cell.done {
  background-color: var(--done-color);
  border-color: var(--done-color);
  color: white;
}

.cell.visited {
  background-color: var(--visited-color);
  border-color: var(--visited-color);
  color: white;
}

.cell.current {
  background-color: var(--current-color);
  border-color: var(--current-color);
  color: white;
}

.cell.min {
  background-color: var(--min-color);
  border-color: var(--min-color);
  color: white;
}

/* Footer */
footer {
  text-align: center;
  font-size: 18px;
  color: var(--text-dark);
  padding: 1.6em;
}

.footer > p:nth-child(1) {
  margin-bottom: 0.6em;
}

.link {
  text-decoration: none;
  font-weight: bold;
  color: var(--secondary-color);
  font-size: 20px;
}

/* Responsive */
@media screen and (max-width: 600px) {
  .navbar {
    gap: 0.5em;
  }
  .title {
    font-size: 18px;
  }
  .navbar a,
  .navbar * {
    font-size: 14px;
  }
  .footer {
    font-size: 16px;
  }
  a#random {
    order: 4;
  }
  a.start {
    order: 5;
  }
}

@media screen and (max-width: 550px) {
  .center {
    width: 95%;
  }
}
