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

body {
  display: grid;
  grid-template-rows: 1fr 7fr 1fr;
  gap: 1vmin;
  padding: 2vmin;
  box-sizing: border-box;
}

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

.activity-title {
  width: 100%;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3.5vmin 0.25vmin -2.5vmin rgba(0, 0, 0, 0.1);
  padding: 1.5vmin 3vmin;
  background-color: var(--white-colour);
  border-radius: 1vmin;
  border: 1px solid rgba(0, 0, 0, 0.075);
  min-width: 200px;
}

.activity-title span {
  display: inline-block;
  font-size: 3vmin;
  font-weight: 600;
  color: var(--dark-colour);
  outline: none;
  min-width: 200px;
  min-height: 1.2em;
}

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

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

/* -------------------------------------------------------------------------- */
/*                               SLOTS CONTAINER                              */
/* -------------------------------------------------------------------------- */

.slots-container {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2vmin;
  overflow-y: auto;
  overflow-x: hidden;
}

.slot {
  display: flex;
  align-items: center;
  gap: 2vmin;
  min-height: 8vmin;
  padding: 1.5vmin 2vmin;
  background-color: rgba(0, 0, 0, 0.03);
  border: 2px dashed rgba(0, 0, 0, 0.1);
  border-radius: 1vmin;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease;
}

.slot.drag-over {
  background-color: rgba(232, 51, 44, 0.08);
  border-color: var(--dark-colour);
  transform: scale(1.01);
}

.slot .position-indicator {
  font-size: 2.5vmin;
  font-weight: 800;
  min-width: 5vmin;
  height: 5vmin;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.75vmin;
  background-color: rgba(0, 0, 0, 0.05);
  color: var(--dark-colour);
  flex-shrink: 0;
}

.slot .slot-content {
  flex: 1;
  display: flex;
  align-items: center;
  min-height: 5vmin;
}

.slot .slot-content .item-text {
  font-size: 2.5vmin;
  color: var(--dark-colour);
  word-break: break-word;
  line-height: 1.4;
}

/* Slot with committed item */
.slot.committed {
  background-color: transparent;
  border-color: transparent;
  cursor: default;
}

.slot.committed .position-indicator {
  background-color: var(--dark-colour);
  color: var(--white-colour);
}

/* Slot with pending (uncommitted) item */
.slot.pending {
  background-color: var(--white-colour);
  border: 2px solid var(--dark-colour);
}

.slot.pending .position-indicator {
  background-color: var(--dark-colour);
  color: var(--white-colour);
}

/* -------------------------------------------------------------------------- */
/*                                ACTIVE AREA                                 */
/* -------------------------------------------------------------------------- */

.active-area {
  display: flex;
  align-items: center;
  justify-content: center;
  /* Match slots-container padding exactly */
  padding: 0 2vmin;
  position: relative;
}

.active-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  /* Full width - matches slot width */
  width: 100%;
  min-height: 8vmin;
  padding: 2vmin 3vmin;
  background-color: var(--dark-colour);
  color: var(--white-colour);
  border-radius: 1vmin;
  font-size: 2.5vmin;
  font-weight: 300;
  text-align: center;
  cursor: grab;
  touch-action: none;
  user-select: none;
  box-shadow: 0 0.75vmin 0 -0.5vmin rgba(0, 0, 0, 0.2);
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
  box-sizing: border-box;
  border-bottom: 1px solid rgba(0, 0, 0, 0.3);
}

.active-panel:active {
  cursor: grabbing;
}

.active-panel.dragging {
  position: fixed;
  z-index: 1000;
  cursor: grabbing;
  box-shadow: 0 5vmin 0.25vmin -3vmin rgba(0, 0, 0, 0.1);
}

.active-panel.hidden {
  display: none;
}

/* Completed state */
.active-area.completed {
  background-color: transparent;
  border-radius: 1vmin;
}

.active-area.completed .active-panel {
  background-color: var(--white-colour);
  cursor: default;
  box-shadow: none;
  border: none;
  box-shadow: 0 3.5vmin 0.25vmin -2.5vmin rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(0, 0, 0, 0.075);
}

.active-area.completed .active-panel p {
  color: #000;
  font-weight: 700;
  font-size: 2.5vmin;
  opacity: 0.9;
}

.active-area.completed .active-panel svg {
  width: 5vmin;
  height: 5vmin;
  opacity: 0.9;
}

.discussMsg {
  display: flex;
  align-items: center;
  justify-content: center;
  column-gap: 2.5vmin;
}

/* -------------------------------------------------------------------------- */
/*                                CONFIRM BAR                                 */
/* -------------------------------------------------------------------------- */

.confirm-bar {
  position: fixed;
  bottom: 3vmin;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5vmin;
  padding: 1.5vmin 6vmin;
  background-color: var(--white-colour);
  border-radius: 1vmin;
  z-index: 500;
  box-shadow:
    rgba(9, 30, 66, 0.25) 0px 4px 8px -2px,
    rgba(9, 30, 66, 0.08) 0px 0px 0px 1px;
}

.confirm-bar.hidden {
  display: none;
}

.confirm-bar p {
  margin: 0;
  font-weight: 700;
  font-size: 2.5vmin;
  color: var(--grey-colour);
  text-transform: uppercase;
}

.btn-row {
  display: flex;
  gap: 3vmin;
}

.btn-row .simpleButton {
  min-width: 10vmin;
}

.btn-row .simpleButton p {
  font-size: 2vmin;
}

/* -------------------------------------------------------------------------- */
/*                              ANIMATIONS                                    */
/* -------------------------------------------------------------------------- */

@keyframes slideInFromBottom {
  from {
    opacity: 0;
    transform: translateY(30%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.active-panel.entering {
  animation: slideInFromBottom 0.3s ease-out forwards;
}

/* Heartbeat animation for pending slot */
.heartbeat {
  animation: heartbeat 1.5s ease-in-out infinite both;
}

@keyframes heartbeat {
  from {
    transform: scale(1);
    transform-origin: center center;
    animation-timing-function: ease-out;
  }
  10% {
    transform: scale(0.98);
    animation-timing-function: ease-in;
  }
  17% {
    transform: scale(0.99);
    animation-timing-function: ease-out;
  }
  33% {
    transform: scale(0.97);
    animation-timing-function: ease-in;
  }
  45% {
    transform: scale(1);
    animation-timing-function: ease-out;
  }
}
