html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  background-color: var(--light-colour);
  overflow: hidden;
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2vmin;
}

/* -------------------------------------------------------------------------- */
/*                                   TITLE                                    */
/* -------------------------------------------------------------------------- */

.activity-title {
  width: 90%;
  max-width: 1000px;
  text-align: center;
  position: relative;
  z-index: 200;
  margin-top: 2vmin;
}

.activity-title[hidden] {
  display: none;
}

.activity-title span {
  display: inline-block;
  font-size: 3vmin;
  font-weight: 600;
  color: var(--dark-colour);
  padding: 1.5vmin 3vmin;
  background-color: var(--white-colour);
  border-radius: 1vmin;
  border: 1px solid rgba(0, 0, 0, 0.075);
  min-width: 200px;
  outline: none;
}

.activity-title span:empty::before {
  content: attr(data-placeholder);
  color: rgba(0, 0, 0, 0.3);
}

.activity-title span:focus {
  border-color: var(--dark-colour);
}

/* -------------------------------------------------------------------------- */
/*                                    ORDER                                   */
/* -------------------------------------------------------------------------- */

#order {
  list-style: none;
  margin: 0;
  padding: 5vmin 3vmin;
  width: 90%;
  max-width: 1000px;
  max-height: 90vh;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 1.5vmin;
  overflow-x: hidden;
  overflow-y: auto;
  background-color: rgba(0, 0, 0, 0.02);
  border-radius: 1vmin;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  border-bottom: 1px solid #fff;
}

/* Wide scrollbar for touch screens */
#order::-webkit-scrollbar {
  width: 20px;
}

#order::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 10px;
}

#order::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
}

#order::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3);
}

.order-item {
  display: flex;
  align-items: center;
  gap: 2vmin;
  font-size: 2.5vmin;
  padding: 2vmin 3vmin;
  background-color: var(--white-colour);
  border-radius: 1vmin;
  border: 1px solid rgba(0, 0, 0, 0.075);
  color: var(--dark-colour);
  user-select: none;
  cursor: grab;
  touch-action: none;
  flex-shrink: 0;
  transition:
    background-color 0.4s ease,
    color 0.4s ease,
    border-color 0.4s ease;
}

.order-item:active {
  cursor: grabbing;
}

.order-item .position-indicator {
  font-size: 2vmin;
  font-weight: 800;
  min-width: 4vmin;
  height: 4vmin;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.75vmin;
  background-color: rgba(0, 0, 0, 0.035);
  color: var(--dark-colour);
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
}

.order-item .item-text {
  flex: 1;
  text-align: left;
  word-break: break-word;
  line-height: 1.4;
}

/* ------------------------------ DRAGGING CSS ------------------------------ */

.order-item.dragging {
  background-color: var(--dark-colour);
  box-shadow: 0 3vmin 0 -2vmin rgba(0, 0, 0, 0.1);
  border: none;
  color: var(--light-colour);
  cursor: grabbing;
  position: relative;
}

.order-item.dragging .position-indicator {
  background-color: var(--dark-colour);
  color: var(--white-colour);
}

/* Bounce animation when dropped */
.order-item.just-dropped {
  animation: bounce-settle 0.3s ease-out;
}

@keyframes bounce-settle {
  0% {
    transform: scale(1.03);
  }
  50% {
    transform: scale(0.98);
  }
  100% {
    transform: scale(1);
  }
}
