html, body {
  margin: 0;
  overflow: hidden;
}

.stage {
  box-sizing: border-box;
  min-height: 100vh;
  display: grid;
  place-items: center;
  margin: 0;
  background: #ff4d1f;
  font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
  padding: clamp(8px, 4vw, 24px);
}

.mf {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mf__hint {
  margin: 0;
  padding: 0 4px;
  font-weight: 500;
  font-size: 11px;
  line-height: 1.4;
  color: #fff7e6;
}

.mf__zone {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 68px;
  padding: 12px;
  border: 2px dashed rgba(255, 247, 230, 0.72);
  border-radius: 16px;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 220ms ease-out, background 220ms ease-out;
}

.mf__zone.is-over {
  border-color: #93d9c0;
  background: rgba(147, 217, 192, 0.14);
}

.mf__file {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.mf__ic {
  width: 28px;
  height: 28px;
  color: #fff7e6;
  transition: transform 220ms cubic-bezier(0.2, 1.4, 0.4, 1);
}

.mf__zone.is-over .mf__ic {
  transform: scale(1.18);
}

.mf__over-flag {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #fff7e6;
  color: #c93000;
  font-weight: 700;
  font-size: 10px;
  line-height: 1.2;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 220ms ease-out, transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.mf__over-flag.is-on {
  opacity: 1;
  transform: translateY(0);
}

.mf__slots {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
}

.mf__slot {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  height: 24px;
  padding: 0 4px;
  border-radius: 8px;
  background: rgba(255, 247, 230, 0.94);
  overflow: hidden;
}

.mf__slot.is-empty {
  background: transparent;
  border: 2px dashed rgba(255, 247, 230, 0.5);
}

.mf__slot.is-pop {
  animation: mfPop 220ms cubic-bezier(0.2, 1.4, 0.4, 1) both;
}

.mf__dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.mf__name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-weight: 500;
  font-size: 9px;
  color: #17141a;
}

.mf__meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 0 4px;
}

.mf__tag {
  font-weight: 700;
  font-size: 12px;
  color: #fff7e6;
}

.mf__unit {
  font-weight: 400;
  font-size: 10px;
  color: rgba(255, 247, 230, 0.72);
}

.mf__pile {
  margin: 0;
  padding: 0 4px;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 300ms ease-out;
}

.mf__pile:not(:empty) {
  max-height: 48px;
}

.mf__piled {
  font-weight: 400;
  font-size: 10px;
  color: rgba(255, 247, 230, 0.72);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@keyframes mfPop {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
@media (max-width: 340px) {
  .mf {
    max-width: 280px;
    gap: 4px;
  }
  .mf__hint {
    font-size: 9px;
    line-height: 1.25;
  }
  .mf__zone {
    min-height: 40px;
    padding: 8px;
  }
  .mf__ic {
    width: 22px;
    height: 22px;
  }
  .mf__slot {
    height: 20px;
  }
  .mf__name {
    font-size: 8px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .mf__slot.is-pop {
    animation: none;
  }
  .mf__zone, .mf__ic, .mf__over-flag {
    transition: none;
  }
  .mf__zone.is-over .mf__ic {
    transform: none;
  }
  .mf__pile {
    transition: none;
  }
}
